tests: fix tests failing on 32-bit arch

E.g. GOARCH=386 go test ./...

- Some tests were failing because of Int overflow;
- Test ExampleRego_custom_function_caching was failing
  because it was dependent of rand default seed on 64bits arch.

Signed-off-by: Olivier Lemasle <o.lemasle@gmail.com>
This commit is contained in:
Olivier Lemasle
2020-10-27 15:07:47 +01:00
committed by Torin Sandall
parent d8947db27d
commit c9e1d024e1
3 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -167,9 +167,9 @@ func TestDFSPath(t *testing.T) {
}
t3 := newTestTraversal(g)
p3 := DFSPath(t3, t3.Equals, 1, 0xdeadbeef)
p3 := DFSPath(t3, t3.Equals, 1, 0xadbeef)
if len(p3) != 0 {
t.Errorf("Expected DFS(1,0xdeadbeef to be empty but got: %v", p3)
t.Errorf("Expected DFS(1,0xadbeef to be empty but got: %v", p3)
}
}