Skip to content

Commit

Permalink
Added test for 2d arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Dec 31, 2024
1 parent 1648762 commit e4a764b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/vector_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,10 @@ def test_array
assert_equal [[1, 2, 3], [4, 5, 6]], item.embeddings
assert_equal [[1, 2, 3], [4, 5, 6]], Item.last.embeddings
end

def test_array_2d
item = Item.create!(embeddings: [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]])
assert_equal [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]], item.embeddings
assert_equal [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]], Item.last.embeddings
end
end

0 comments on commit e4a764b

Please sign in to comment.