Пример #1
0
        public void Token_splits_on_spaces_correctly()
        {
            var s      = "//*[@id=\"hello space\"]";
            var tokens = DomPathParser.Tokens(s);

            Assert.Equal(
                new [] { "//", "*", "[", "@", "id", "=", "hello space", "]", "<eof>" },
                tokens.Select(t => t.Value)
                );
        }
Пример #2
0
        public void Tokens_splits_on_quotes_internally()
        {
            var s      = "/root//*[@id=\"hello\"]";
            var tokens = DomPathParser.Tokens(s);

            Assert.Equal(
                new [] { "/", "root", "//", "*", "[", "@", "id", "=", "hello", "]", "<eof>" },
                tokens.Select(t => t.Value)
                );
        }