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].
This commit is contained in:
Ben North 2016-07-05 19:59:28 +01:00
parent 676e29885b
commit 150a0fa786

View File

@ -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]))