From cf9f7aeea90cdfa29fdd8535a0c724dcb23eee5b Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 1 Sep 2023 19:57:28 -0700 Subject: [PATCH] Added another test for cosine distance [skip ci] --- test/expected/functions.out | 6 ++++++ test/sql/functions.sql | 1 + 2 files changed, 7 insertions(+) diff --git a/test/expected/functions.out b/test/expected/functions.out index 16092ba..1fe90c6 100644 --- a/test/expected/functions.out +++ b/test/expected/functions.out @@ -106,6 +106,12 @@ SELECT cosine_distance('[1,1]', '[1,1]'); 0 (1 row) +SELECT cosine_distance('[1,0]', '[0,1]'); + cosine_distance +----------------- + 1 +(1 row) + SELECT cosine_distance('[1,1]', '[-1,-1]'); cosine_distance ----------------- diff --git a/test/sql/functions.sql b/test/sql/functions.sql index 78ec8c1..194c120 100644 --- a/test/sql/functions.sql +++ b/test/sql/functions.sql @@ -25,6 +25,7 @@ SELECT inner_product('[3e38]', '[3e38]'); SELECT cosine_distance('[1,2]', '[2,4]'); SELECT cosine_distance('[1,2]', '[0,0]'); SELECT cosine_distance('[1,1]', '[1,1]'); +SELECT cosine_distance('[1,0]', '[0,1]'); SELECT cosine_distance('[1,1]', '[-1,-1]'); SELECT cosine_distance('[1,2]', '[3]'); SELECT cosine_distance('[1,1]', '[1.1,1.1]');