Ejemplo n.º 1
0
        public void MoveNextLineReturnsLine()
        {
            string text = "This is a line \\ \r\nAnd this is next";

            LookAheadTokenParser parser = new LookAheadTokenParser(TestUtil.GetTextStream(text), new string[] { }, false);

            Assert.AreEqual("This", parser.PeekNextToken());
            Assert.AreEqual("This is a line \\ ", parser.MoveToNextLine());
            Assert.AreEqual("And", parser.PeekNextToken());
        }
Ejemplo n.º 2
0
        public void MoveToNextLine()
        {
            string text = "&& || somecrap \r\n" +
                          "text";

            LookAheadTokenParser parser = new LookAheadTokenParser(TestUtil.GetTextStream(text),
                                                                   new string[] { "&&", "||" }, true);

            Assert.AreEqual("&&", parser.NextToken());
            Assert.AreEqual("||", parser.NextToken());

            parser.MoveToNextLine();

            Assert.AreEqual("text", parser.PeekNextToken());
        }