Skip to content

Commit

Permalink
test: make sure the vector values are compared by sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-sunset committed Sep 25, 2024
1 parent 56de307 commit c11c916
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/DataTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public async Task Query_with_basic_metadata_filter()
var ordered = result.OrderBy(x => x.Id).ToList();

Assert.Equal("metadata-vector-1", ordered[0].Id);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values!.Value);
Assert.Equal("metadata-vector-2", ordered[1].Id);
Assert.Equal(new[] { 0f, 1, 1, 2, 3, 5, 8, 13 }, ordered[1].Values);
Assert.Equal(new[] { 0f, 1, 1, 2, 3, 5, 8, 13 }, ordered[1].Values!.Value);
Assert.Equal("metadata-vector-3", ordered[2].Id);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[2].Values);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[2].Values!.Value);
}

[PineconeFact]
Expand All @@ -74,7 +74,7 @@ public async Task Query_include_metadata_in_result()

Assert.Single(result);
Assert.Equal("metadata-vector-2", result[0].Id);
Assert.Equal(new[] { 0f, 1, 1, 2, 3, 5, 8, 13 }, result[0].Values);
Assert.Equal(new[] { 0f, 1, 1, 2, 3, 5, 8, 13 }, result[0].Values!.Value);
var metadata = result[0].Metadata;
Assert.NotNull(metadata);

Expand All @@ -101,9 +101,9 @@ public async Task Query_with_metadata_filter_composite()
var ordered = result.OrderBy(x => x.Id).ToList();

Assert.Equal("metadata-vector-1", ordered[0].Id);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values!.Value);
Assert.Equal("metadata-vector-3", ordered[1].Id);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[1].Values);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[1].Values!.Value);
}

[PineconeFact]
Expand All @@ -120,9 +120,9 @@ public async Task Query_with_metadata_list_contains()
var ordered = result.OrderBy(x => x.Id).ToList();

Assert.Equal("metadata-vector-1", ordered[0].Id);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values!.Value);
Assert.Equal("metadata-vector-3", ordered[1].Id);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[1].Values);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[1].Values!.Value);
}

[PineconeFact]
Expand Down Expand Up @@ -150,9 +150,9 @@ public async Task Query_with_metadata_complex()
var ordered = result.OrderBy(x => x.Id).ToList();

Assert.Equal("metadata-vector-1", ordered[0].Id);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values);
Assert.Equal(new[] { 2f, 3, 5, 7, 11, 13, 17, 19 }, ordered[0].Values!.Value);
Assert.Equal("metadata-vector-3", ordered[1].Id);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[1].Values);
Assert.Equal(new[] { 2f, 1, 3, 4, 7, 11, 18, 29 }, ordered[1].Values!.Value);
}

[PineconeFact]
Expand Down

0 comments on commit c11c916

Please sign in to comment.