Skip to content

Commit

Permalink
TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
Cypher1 committed Sep 24, 2024
1 parent 10dd76c commit d487b18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions partable-parser/src/tests/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,15 @@ mod example1 {
fn table_test_4() {
let rules = &get_rules()[..4]; // ExprMulHole Expr -> Expr
let state = setup(EXAMPLE, rules);
assert_eq!(format!("{:?}", state.entries), "[OpenParen@0, Expr@1(Digits_0), AddOp@2, Expr@3(Digits_1), CloseParen@6, MulOp@7, Expr@8(Digits_4)]");
assert_eq!(format!("{:?}", state.entries), "[OpenParen@0..1, Expr@1..2(Digits_0), AddOp@2..3, Expr@3..6(Digits_6), CloseParen@6..7, MulOp@7..8, Expr@8..9(Digits_4)]");
// TODO: Add test case for this that is not a noop.
}

#[test]
fn table_test_5() {
let rules = &get_rules()[..5]; // Expr + -> ExprAddHole
let state = setup(EXAMPLE, rules);
assert_eq!(format!("{:?}", state.entries), "[OpenParen@0, ExprAddHole@1(Noop_0), Expr@3(Digits_1), CloseParen@6, MulOp@7, Expr@8(Digits_4)]");
assert_eq!(format!("{:?}", state.entries), "[OpenParen@0..1, ExprAddHole@1..3(Digits_0), Expr@3..6(Digits_1), CloseParen@6..7, MulOp@7..8, Expr@8..9(Digits_4)]");
// TODO: Add test case for this that is not a noop.
}

Expand Down Expand Up @@ -599,7 +599,7 @@ mod example1 {
fn table_test_all() {
let rules = get_rules();
let state = setup(EXAMPLE, &rules);
assert_eq!(format!("{:?}", state.entries), "[[email protected](Expr_4)]");
assert_eq!(format!("{:?}", state.entries), "[[email protected](Mul_0)]");
// assert_eq!(format!("{:?}", state.expression_table), "");
}
}
Expand Down Expand Up @@ -638,15 +638,15 @@ mod example2 {
fn table_test_4() {
let rules = &get_rules()[..4]; // ExprMulHole Expr -> Expr
let state = setup(EXAMPLE, rules);
assert_eq!(format!("{:?}", state.entries), "[Expr@0(Digits_0), AddOp@1, OpenParen@2, Expr@3(Digits_4), AddOp@4, Expr@5(Digits_2), CloseParen@8, MulOp@9, Expr@10(Digits_5)]");
assert_eq!(format!("{:?}", state.entries), "[Expr@0..1(Digits_0), AddOp@1..2, OpenParen@2..3, Expr@3..4(Digits_1), AddOp@4..5, Expr@5..8(Digits_7), CloseParen@8..9, MulOp@9..10, Expr@10..11(Digits_5)]");
// TODO: Add test case for this that is not a noop.
}

#[test]
fn table_test_5() {
let rules = &get_rules()[..5]; // Expr + -> ExprAddHole
let state = setup(EXAMPLE, rules);
assert_eq!(format!("{:?}", state.entries), "[ExprAddHole@0(Digits_0), OpenParen@2, Expr@3(Digits_4), Expr@5(Digits_2), CloseParen@8, MulOp@9, Expr@10(Digits_5)]");
assert_eq!(format!("{:?}", state.entries), "[ExprAddHole@0..1(Digits_0), OpenParen@2..3, [email protected](Digits_1), Expr@5..8(Digits_7), CloseParen@8..9, MulOp@9..10, Expr@10..11(Digits_5)]");
// TODO: Add test case for this that is not a noop.
}

Expand Down Expand Up @@ -674,7 +674,7 @@ mod example2 {
fn table_test_all() {
let rules = get_rules();
let state = setup(EXAMPLE, &rules);
assert_eq!(format!("{:?}", state.entries), "[[email protected](Expr_5)]");
assert_eq!(format!("{:?}", state.entries), "[[email protected](Add_1)]");
// assert_eq!(format!("{:?}", state.expression_table), "");
}
}

0 comments on commit d487b18

Please sign in to comment.