Exemple #1
0
        public void TestErr()
        {
            var ncccParser0 = new NcGP();
            var ncGrammer   = NcGP.GetNcGrammerSource();
            var ncccParser1 = NcParser.Load(ncGrammer);
            var ncccParser2 = _P2P(ncccParser1, ncGrammer);
            var errGrammer  = @"::dummy @hehe '123'";
            var pr0         = ncccParser0.Parse(errGrammer);
            var pr1         = ncccParser1.Parse(errGrammer);
            var pr2         = ncccParser2.Parse(errGrammer);

            Assert.IsFalse(pr0.IsSuccess());
            Assert.IsFalse(pr1.IsSuccess());
            Assert.IsFalse(pr2.IsSuccess());
            Assert.AreEqual(0, Utils.DiffAndShow(pr0, pr1).Count());
            Assert.AreEqual(0, Utils.DiffAndShow(pr0, pr2).Count());
        }
Exemple #2
0
        public void TestSelf()
        {
            var ncccParser0 = new NcGP();
            var ncGrammer   = NcGP.GetNcGrammerSource();
            var ncccParser1 = NcParser.Load(ncGrammer);
            var ncccParser2 = _P2P(ncccParser1, ncGrammer);
            var pr0         = ncccParser0.Parse(ncGrammer);

            Assert.IsTrue(pr0.IsSuccess());
            var pr1 = ncccParser1.Parse(ncGrammer);

            Assert.IsTrue(pr1.IsSuccess());
            Assert.AreEqual(0, Utils.DiffAndShow(pr0, pr1).Count());
            var pr2 = ncccParser2.Parse(ncGrammer);

            Assert.IsTrue(pr2.IsSuccess());
            Assert.AreEqual(0, Utils.DiffAndShow(pr0, pr2).Count());
        }