Skip to content

Commit a48e54c

Browse files
committed
Improved test
1 parent 2659e45 commit a48e54c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/sparsevec_test.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ static void test_constructor_map() {
2727
assert_equal(vec.values() == std::vector<float>{1, 2, 3}, true);
2828

2929
assert_exception<std::invalid_argument>([&]{
30-
SparseVector(map, -1);
30+
SparseVector{map, -1};
3131
}, "sparsevec cannot have negative dimensions");
3232

3333
assert_exception<std::invalid_argument>([&]{
34-
SparseVector(map, 4);
34+
SparseVector{map, 4};
35+
}, "sparsevec index out of bounds");
36+
37+
assert_exception<std::invalid_argument>([]{
38+
SparseVector{{{0, 1}}, 0};
3539
}, "sparsevec index out of bounds");
3640
}
3741

0 commit comments

Comments
 (0)