Skip to content

Commit

Permalink
extend test for traverse_path
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Feb 2, 2024
1 parent b0e68a4 commit 225269e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/traverse_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ fn test_traverse_path() {
let n1 = a.new_atom(&[0, 1, 2]).unwrap();
let n2 = a.new_atom(&[4, 5, 6]).unwrap();

assert_eq!(traverse_path(&a, &[0], n1).unwrap(), Reduction(48, nul));
assert_eq!(traverse_path(&a, &[], n1).unwrap(), Reduction(44, nul));
assert_eq!(traverse_path(&a, &[0b1], n1).unwrap(), Reduction(44, n1));
assert_eq!(traverse_path(&a, &[0b1], n2).unwrap(), Reduction(44, n2));

// cost for leading zeros
assert_eq!(traverse_path(&a, &[0], n1).unwrap(), Reduction(48, nul));
assert_eq!(traverse_path(&a, &[0, 0], n1).unwrap(), Reduction(52, nul));
assert_eq!(
traverse_path(&a, &[0, 0, 0], n1).unwrap(),
Reduction(54, nul)
);
assert_eq!(
traverse_path(&a, &[0, 0, 0, 0], n1).unwrap(),
Reduction(60, nul)
Expand Down

0 comments on commit 225269e

Please sign in to comment.