From f1286d6eec7d449637e8d7af7a999b873a1189a2 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 13 Oct 2023 14:50:18 -0700 Subject: [PATCH] Added vector tests --- tests/Pgvector.Tests/VectorTests.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/Pgvector.Tests/VectorTests.cs diff --git a/tests/Pgvector.Tests/VectorTests.cs b/tests/Pgvector.Tests/VectorTests.cs new file mode 100644 index 0000000..f44aa53 --- /dev/null +++ b/tests/Pgvector.Tests/VectorTests.cs @@ -0,0 +1,26 @@ +using Pgvector; + +namespace Pgvector.Tests; + +public class VectorTests +{ + [Fact] + public void Equal() + { + var a = new Vector(new float[] { 1, 1, 1 }); + var b = new Vector(new float[] { 1, 1, 1 }); + var c = new Vector(new float[] { 1, 2, 3 }); + + Assert.Equal(a, a); + Assert.Equal(a, b); + Assert.NotEqual(a, c); + + Assert.True(a == a); + Assert.True(a == b); + Assert.False(a == c); + + Assert.False(a != a); + Assert.False(a != b); + Assert.True(a != c); + } +}