Commit 150a0fa7 by Ben North

check(): Stricter check in tests

Previous version would give false 'OK' if, for example, we were supposed
to get [1, 2, 3] but instead got [2, 1, 3].
parent 676e2988
...@@ -22,7 +22,7 @@ ref = np.array( ...@@ -22,7 +22,7 @@ ref = np.array(
def check(mat): def check(mat):
return 'OK' if np.sum(mat - ref) == 0 else 'NOT OK' return 'OK' if np.sum(abs(mat - ref)) == 0 else 'NOT OK'
print("should_give_NOT_OK = %s" % check(ref[:, ::-1])) print("should_give_NOT_OK = %s" % check(ref[:, ::-1]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment