sophiajt / new-nu-parser

23 stars 10 forks source link

`cargo test` failing checks with `insta` #7

Closed AucaCoyan closed 11 months ago

AucaCoyan commented 11 months ago

Hi! First time with insta, I heard it before, but I've never used. So when I did

cargo test

I obtained failing tests

``` Expression: evaluate_example(path) ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -old snapshot +new results ────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────── 0 0 │ 0: Variable (4 to 5) 1 1 │ 1: Int (8 to 11) 2 2 │ 2: Let { variable_name: NodeId(0), ty: None, initializer: NodeId(1), is_mutable: false } (0 to 11) 3 │-3: Variable (16 to 18) 4 │-4: LessThan (19 to 20) 5 │-5: Int (21 to 24) 6 │-6: BinaryOp { lhs: NodeId(3), op: NodeId(4), rhs: NodeId(5) } (16 to 24) 7 │-7: Int (31 to 32) 8 │-8: Block(BlockId(0)) (25 to 34) 9 │-9: Int (46 to 47) 10 │-10: Block(BlockId(1)) (40 to 49) 11 │-11: If { condition: NodeId(6), then_block: NodeId(8), else_expression: Some(NodeId(10)) } (13 to 49) 3 │+3: Variable (18 to 20) 4 │+4: LessThan (21 to 22) 5 │+5: Int (23 to 26) 6 │+6: BinaryOp { lhs: NodeId(3), op: NodeId(4), rhs: NodeId(5) } (18 to 26) 7 │+7: Int (34 to 35) 8 │+8: Block(BlockId(0)) (27 to 38) 9 │+9: Int (51 to 52) 10 │+10: Block(BlockId(1)) (44 to 55) 11 │+11: If { condition: NodeId(6), then_block: NodeId(8), else_expression: Some(NodeId(10)) } (15 to 55) 12 12 │ 12: Block(BlockId(2)) (0 to 0) ```
AucaCoyan commented 11 months ago

Some googling later I found that there is an issue with cargo test in the crate of cargo insta. To test the crate, you need to

cargo insta test

I filed an issue, answered myself and close it so others can solve the problem quickly 🙌🏼 Have a great day!