Skip to content

Commit

Permalink
remove iteration count from snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjfvi committed May 21, 2024
1 parent 33649b7 commit a02605b
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 13 deletions.
8 changes: 5 additions & 3 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ fn parse_output(output: &str) -> Result<String, String> {
let mut parser = hvm::ast::CoreParser::new(output);
parser.consume("Result:")?;
let mut tree = parser.parse_tree()?;
parser.consume("- ITRS:")?;
let itrs = parser.parse_u64()?;
normalize_vars(&mut tree, &mut HashMap::new());
Ok(format!("Result: {}\n- ITRS: {}", tree.show(), itrs))
// TODO: include iteration count in snapshot once consistent
// parser.consume("- ITRS:")?;
// let itrs = parser.parse_u64()?;
// Ok(format!("Result: {}\n- ITRS: {}", tree.show(), itrs))
Ok(format!("Result: {}", tree.show()))
}

fn normalize_vars(tree: &mut Tree, vars: &mut HashMap<String, usize>) {
Expand Down
1 change: 0 additions & 1 deletion tests/snapshots/run__file@demo_io__main.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/demo_io/main.hvm
---
Result: ((@PUTTEXT (@Main__C2 ((* ((@PUTTEXT (@Main__C0 ((* ((@DRAWIMAGE (((16711680 65280) (255 16711935)) ((* ((@SLEEP ((119 3511296) ((* ((@DONE (42 x0)) x0)) x1))) x1)) x2))) x2)) x3))) x3)) x4))) x4)
- ITRS: 120
1 change: 0 additions & 1 deletion tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: tests/programs/f24.hvm
---
Result: {+inf {-inf {+NaN {2.5 {-1.5 {1.1499939 {0.25 {0.5 {0 {1 {1 {0 {0 {0 {0 {+NaN {+inf {-inf {1.019989 {0.1000061 {0.1000061 {-0.1000061 {-0.1000061 *}}}}}}}}}}}}}}}}}}}}}}}
- ITRS: 167
1 change: 0 additions & 1 deletion tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: tests/programs/i24.hvm
---
Result: {+12 {+8 {+20 {+5 {+0 {+0 {+1 {+0 {+1 {+2 {+10 {+8 {+8388607 {-8388608 {+1 {+1 {-1 {-1 *}}}}}}}}}}}}}}}}}}
- ITRS: 94
1 change: 0 additions & 1 deletion tests/snapshots/run__file@sort_bitonic__main.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/sort_bitonic/main.hvm
---
Result: 16744448
- ITRS: 253525989
1 change: 0 additions & 1 deletion tests/snapshots/run__file@sort_radix__main.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/sort_radix/main.hvm
---
Result: 16744448
- ITRS: 110821371
1 change: 0 additions & 1 deletion tests/snapshots/run__file@stress__main.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/stress/main.hvm
---
Result: 0
- ITRS: 402675702
1 change: 0 additions & 1 deletion tests/snapshots/run__file@sum_rec__main.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/sum_rec/main.hvm
---
Result: 8388608
- ITRS: 402653167
1 change: 0 additions & 1 deletion tests/snapshots/run__file@sum_tree__main.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/sum_tree/main.hvm
---
Result: 1048576
- ITRS: 44040165
1 change: 0 additions & 1 deletion tests/snapshots/run__file@tuples__tuples.hvm.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: examples/tuples/tuples.hvm
---
Result: ((1 (2 (3 (4 (5 (6 (7 (8 x0)))))))) x0)
- ITRS: 170000018
1 change: 0 additions & 1 deletion tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ expression: rust_output
input_file: tests/programs/u24.hvm
---
Result: {12 {8 {20 {5 {0 {0 {1 {0 {1 {2 {10 {8 {40 {2 {16777215 {0 {3 *}}}}}}}}}}}}}}}}}
- ITRS: 89

0 comments on commit a02605b

Please sign in to comment.