public void Cat2Test() { var list2 = "x y z".Split().Aggregate(CatenableList <string> .Empty, (current, word) => CatenableList <string> .Cons(word, current)); var list3 = CatenableList <string> .Cat(CatenableList <string> .Empty, list2); Assert.AreSame(list2, list3); }
public void Cat1Test() { var list1 = "a b c".Split().Aggregate(CatenableList <string> .Empty, (current, word) => CatenableList <string> .Cons(word, current)); var list3 = CatenableList <string> .Cat(list1, CatenableList <string> .Empty); Assert.AreSame(list1, list3); }
public void Cat3Test() { var list1 = "a b c".Split().Aggregate(CatenableList <string> .Empty, (current, word) => CatenableList <string> .Cons(word, current)); var list2 = "x y z".Split().Aggregate(CatenableList <string> .Empty, (current, word) => CatenableList <string> .Cons(word, current)); var list3 = CatenableList <string> .Cat(list1, list2); Assert.AreEqual("c, b, a, z, y, x", DumpList(list3)); }