Skip to content

Commit

Permalink
Added vector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 13, 2023
1 parent fca6039 commit f1286d6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Pgvector.Tests/VectorTests.cs
Original file line number Diff line number Diff line change
@@ -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);

Check warning on line 18 in tests/Pgvector.Tests/VectorTests.cs

View workflow job for this annotation

GitHub Actions / build

Comparison made to same variable; did you mean to compare something else?
Assert.True(a == b);
Assert.False(a == c);

Assert.False(a != a);

Check warning on line 22 in tests/Pgvector.Tests/VectorTests.cs

View workflow job for this annotation

GitHub Actions / build

Comparison made to same variable; did you mean to compare something else?
Assert.False(a != b);
Assert.True(a != c);
}
}

0 comments on commit f1286d6

Please sign in to comment.