-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
} | ||
|
||
|
@@ -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), ""); | ||
} | ||
} | ||
|
@@ -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. | ||
} | ||
|
||
|
@@ -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), ""); | ||
} | ||
} |