Skip to content

Commit

Permalink
Test same values with euclidean_distance and dot_product functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jul 24, 2024
1 parent 8f38e96 commit 0002afa
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ void testEuclideanDistance()
assertThat(assertions.function("euclidean_distance", "ARRAY[1, 2]", "ARRAY[3, 4]"))
.hasType(DOUBLE)
.isEqualTo(2.8284271247461903);
assertThat(assertions.function("euclidean_distance", "ARRAY[4, 5, 6]", "ARRAY[4, 5, 6]"))
.hasType(DOUBLE)
.isEqualTo(0.0);
assertThat(assertions.function("euclidean_distance", "ARRAY[REAL '1.1', REAL '2.2', REAL '3.3']", "ARRAY[REAL '4.4', REAL '5.5', REAL '6.6']"))
.hasType(DOUBLE)
.isEqualTo(5.715767651212193);
Expand Down Expand Up @@ -147,6 +150,9 @@ void testDotProduct()
assertThat(assertions.function("dot_product", "ARRAY[1, 2]", "ARRAY[3, 4]"))
.hasType(DOUBLE)
.isEqualTo(11.0);
assertThat(assertions.function("dot_product", "ARRAY[4, 5, 6]", "ARRAY[4, 5, 6]"))
.hasType(DOUBLE)
.isEqualTo(77.0);
assertThat(assertions.function("dot_product", "ARRAY[REAL '1.1', REAL '2.2', REAL '3.3']", "ARRAY[REAL '4.4', REAL '5.5', REAL '6.6']"))
.hasType(DOUBLE)
.isEqualTo(38.719999842643745);
Expand Down

0 comments on commit 0002afa

Please sign in to comment.