blob: 2cc730afce4267200d0dfb294898ac6522750801 [file] [log] [blame]
Henri Chataing5a53f3d2022-02-08 11:29:28 +01001// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
3// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4// option. All files in the project carrying such notice may not be copied,
5// modified, or distributed except according to those terms.
6
7#[macro_use]
8extern crate pest;
9#[macro_use]
10extern crate pest_derive;
11
12#[derive(Parser)]
13#[grammar_inline = "string = { \"abc\" }"]
14struct GrammarParser;
15
16#[test]
17fn inline_string() {
18 parses_to! {
19 parser: GrammarParser,
20 input: "abc",
21 rule: Rule::string,
22 tokens: [
23 string(0, 3)
24 ]
25 };
26}