示例#1
0
        public void IsDigitWorksText()
        {
            var parser = IsDigitText.CompileParser("IsDigitWorksText");

            parser.AssertSuccess("000", new StringSpan("000", 0, 3), 3);
            parser.AssertSuccess("A", new StringSpan("A", 0, 0), 0);
            parser.AssertSuccess("909a", new StringSpan("909a", 0, 3), 3);
        }
示例#2
0
        public void IsDigitWorksText()
        {
            var parser = IsDigitText.CompileParser("StringIsDigitWorksText");

            parser.AssertSuccess("000", "000", 3);
            parser.AssertSuccess("A", "", 0);
            parser.AssertSuccess("909a", "909", 3);
        }
示例#3
0
        public void RequiredWorks()
        {
            var parser = IsDigitText.Required().CompileParser("RequiredWorks");

            parser.AssertSuccess("0", new StringSpan("0", 0, 1), 1);
            parser.AssertFailure("", 0);
            parser.AssertFailure("a", 0);
            parser.AssertSuccess("000", new StringSpan("000", 0, 3), 3);
        }