From 150a0fa786157dea15c71090f01645a0a88a6351 Mon Sep 17 00:00:00 2001 From: Ben North Date: Tue, 5 Jul 2016 19:59:28 +0100 Subject: [PATCH] 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]. --- example/eigen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/eigen.py b/example/eigen.py index 57c516a15..7ff9aed5d 100644 --- a/example/eigen.py +++ b/example/eigen.py @@ -22,7 +22,7 @@ ref = np.array( 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]))