Ejemplo n.º 1
0
        public void CatLeftEmptyTest()
        {
            const string data = "How now, brown cow?";
            var          list = data.Split().Aggregate(RList <string> .Empty, (current, word) => RList <string> .Cons(word, current));

            var list2 = RList <string> .Cat(RList <string> .Empty, list);

            Assert.AreSame(list, list2);
        }
Ejemplo n.º 2
0
        public void CatTest()
        {
            const string data1 = "How now,";
            var          list1 = data1.Split().Aggregate(RList <string> .Empty, (current, word) => RList <string> .Cons(word, current));

            const string data2 = "brown cow?";
            var          list2 = data2.Split().Aggregate(RList <string> .Empty, (current, word) => RList <string> .Cons(word, current));

            var list3 = RList <string> .Cat(list1, list2);

            Assert.AreEqual("[now,, How, cow?, brown]", list3.ToReadableString());
        }
Ejemplo n.º 3
0
        public void CatBothEmptyTest()
        {
            var list = RList <string> .Cat(RList <string> .Empty, RList <string> .Empty);

            Assert.IsTrue(RList <string> .IsEmpty(list));
        }