Skip to content

Commit 9e8d376

Browse files
committed
add tests
1 parent 7db4263 commit 9e8d376

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/tests.nr

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ fn test_poseidon_hash_8() {
6666
assert_eq(hash, expected);
6767
}
6868

69+
#[test]
70+
fn test_poseidon2_1() {
71+
let input = [1000];
72+
let hash = poseidon2::Poseidon2::hash(input, input.len());
73+
let expected = 0x16433a80e26a23547e25d61dd95fd5793d1ca2dcd78ae64cd146d3b99a35fa7c;
74+
assert_eq(hash, expected);
75+
}
76+
6977
#[test]
7078
fn test_poseidon2_2() {
7179
let input = [1000, 2000];
@@ -75,9 +83,9 @@ fn test_poseidon2_2() {
7583
}
7684

7785
#[test]
78-
fn test_poseidon2_1() {
79-
let input = [1000];
86+
fn test_poseidon2_3() {
87+
let input = [1000, 2000, 3000];
8088
let hash = poseidon2::Poseidon2::hash(input, input.len());
81-
let expected = 0x118d5a5ecb25dafe99eb45cb196604a23d0b7c0cbd0c2be29e0787e59b7a1d8a;
89+
let expected = 0x0f1badcd0d52ced816fb6e6826fdf66ada038135d53cbb993f320ca6529223cd;
8290
assert_eq(hash, expected);
8391
}

0 commit comments

Comments
 (0)