Пример #1
0
		public void FailureFirst()
		{
			IScanner scanner = Provider.NewScanner;
			SequenceParser parser = new SequenceParser(Second, Second2);

			ParserMatch m = parser.Parse(scanner);
			Assert.IsFalse(m.Success);
			Assert.AreEqual(0, scanner.Offset);
		}
Пример #2
0
		public void Success()
		{
			IScanner scanner = Provider.NewScanner;
			SequenceParser parser = new SequenceParser(First, Second);

			ParserMatch m = parser.Parse(scanner);
			Assert.IsTrue(m.Success);
			Assert.AreEqual(m.Offset, 0);
			Assert.AreEqual(m.Offset + m.Length, scanner.Offset);
			Assert.AreEqual(First.MatchedString + Second.MatchedString, m.Value);
		}