Skip to content

Commit 5a0cfad

Browse files
committed
Improved test
1 parent 1bb9978 commit 5a0cfad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ void test_halfvec() {
2121
}
2222

2323
void test_sparsevec() {
24-
auto vec = SparseVector({1, 2, 3});
25-
assert(vec.dimensions() == 3);
24+
auto vec = SparseVector({1, 0, 2, 0, 3, 0});
25+
assert(vec.dimensions() == 6);
26+
assert(vec.indices() == (std::vector<int>{0, 2, 4}));
27+
assert(vec.values() == (std::vector<float>{1, 2, 3}));
2628
}
2729

2830
int main() {

0 commit comments

Comments
 (0)