summaryrefslogtreecommitdiff
path: root/chomp-macro/tests/regex.rs
blob: 1e831b41b217839ab71f5a3531a661d52cd6dd56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
chomp_macro::nibble! {
    let opt(x) = _ | x;
    let plus(x) = [plus](x . opt(plus));
    let star(x) = [star](opt(x . star));

    match plus("a") . star("b");
}

#[test]
fn regex_a() {
    Ast::parse_str("a").unwrap();
}

#[test]
fn regex_ab() {
    Ast::parse_str("ab").unwrap();
}

#[test]
fn regex_aa() {
    Ast::parse_str("aa").unwrap();
}

#[test]
fn regex_aaaabbb() {
    Ast::parse_str("aaaabbb").unwrap();
}