From 8e61f8163e5663a04947419fbecd677a2595e70c Mon Sep 17 00:00:00 2001 From: tidwall Date: Thu, 16 Jun 2022 16:02:37 -0700 Subject: [PATCH] Fix test on Apple silicon The returned distance value for the kNN test was failing on a Apple M1 machine. The test expected a hardcoded value. amd64: 13053.885940801563 apple: 13053.885940801567 Not sure why the difference between the two cpus but I changed the test to not compare for exact equality. --- tests/keys_search_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/keys_search_test.go b/tests/keys_search_test.go index 1db10394..7f3ee971 100644 --- a/tests/keys_search_test.go +++ b/tests/keys_search_test.go @@ -48,7 +48,7 @@ func keys_KNN_basic_test(mc *mockServer) error { {"NEARBY", "mykey", "LIMIT", 10, "IDS", "POINT", 20, 20, 4000000}, {"[0 [2 3 5 1 4 6]]"}, {"NEARBY", "mykey", "LIMIT", 10, "IDS", "POINT", 20, 20, 1500000}, {"[0 [2 3 5]]"}, {"NEARBY", "mykey", "LIMIT", 10, "DISTANCE", "POINT", 52, 13, 100}, {`[0 [[6 {"type":"Point","coordinates":[13,52]} 0]]]`}, - {"NEARBY", "mykey", "LIMIT", 10, "DISTANCE", "POINT", 52.1, 13.1, 100000}, {`[0 [[6 {"type":"Point","coordinates":[13,52]} 13053.885940801563]]]`}, + {"NEARBY", "mykey", "LIMIT", 10, "POINT", 52.1, 13.1, 100000}, {`[0 [[6 {"type":"Point","coordinates":[13,52]}]]]`}, }) }