public void NegateFailParse() { IScanner scanner = Provider.Scanner; NegatableParser parser = -Prims.CharOf(MatchedChar); ParserMatch m = parser.Parse(scanner); Assert.IsTrue(!m.Success); Assert.AreEqual(scanner.Offset, 0); }
public void FailParse() { IScanner scanner = Provider.Scanner; CharParser parser = Prims.CharOf(NonMatchedChar); ParserMatch m = parser.Parse(scanner); Assert.IsTrue(!m.Success); Assert.AreEqual(scanner.Offset, 0); }
public void NegateSuccessParse() { IScanner scanner = Provider.Scanner; NegatableParser parser = -Prims.CharOf(NonMatchedChar); ParserMatch m = parser.Parse(scanner); Assert.IsTrue(m.Success); Assert.AreEqual(m.Offset, 0); Assert.AreEqual(m.Length, 1); Assert.AreEqual(scanner.Offset, 1); }