Ejemplo n.º 1
0
        public void Strings11()
        {
            var list     = FList.AsChars("Henry");
            var expected = "HenryVIII";

            Assert.AreEqual(expected, FList.Append(list, FList.AsChars("VIII")).ToString());
        }
Ejemplo n.º 2
0
                private FList <Variable> AddVariablesForsArrayLengths(APC pc, FList <Variable> variables)
                {
                    Contract.Ensures(variables == null || Contract.Result <FList <Variable> >() != null);

                    if (variables == FList <Variable> .Empty)
                    {
                        return(variables);
                    }

                    var postPC       = pc.Post();
                    var arrayLenghts = FList <Variable> .Empty;

                    foreach (var v in variables.GetEnumerable())
                    {
                        Variable vLength;
                        if (this.mDriver.Context.ValueContext.TryGetArrayLength(postPC, v, out vLength))
                        {
                            arrayLenghts = arrayLenghts.Cons(vLength);
                        }
                    }

                    if (!arrayLenghts.IsEmpty())
                    {
                        variables = variables.Append(arrayLenghts);
                        Contract.Assert(variables != null);
                    }

                    return(variables);
                }
Ejemplo n.º 3
0
        public void Strings9()
        {
            var str      = "Harry";
            var expected = "HarryVI";

            Assert.AreEqual(expected, FList.Append(str, "VI").ToString());
        }
Ejemplo n.º 4
0
        public void Append1()
        {
            var list     = FList.New(1, 2, 3);
            var actual   = FList.Append(list, FList.New(4));
            var expected = FList.New(1, 2, 3, 4);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 5
0
        public void Append4()
        {
            var list     = FList.New(1, 2);
            var actual   = FList.Append(list, FList.New(4, 7));
            var expected = FList.New(1, 2, 4, 7);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 6
0
        public void Append3()
        {
            var list     = FList.Empty <int>();
            var actual   = FList.Append(list, FList.New(4));
            var expected = FList.New(4);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 7
0
        public void Append4String()
        {
            var list     = "12";
            var actual   = FList.Append(list, "47");
            var expected = "1247";

            Assert.AreEqual(expected, actual.ToString());
        }