We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfa1b09 commit 9de20b8Copy full SHA for 9de20b8
test/halfvec_test.cpp
@@ -23,6 +23,11 @@ static void test_constructor_empty() {
23
assert_equal(vec.dimensions(), 0u);
24
}
25
26
+static void test_dimensions() {
27
+ HalfVector vec{{1, 2, 3}};
28
+ assert_equal(vec.dimensions(), 3u);
29
+}
30
+
31
static void test_values() {
32
HalfVector vec{{1, 2, 3}};
33
assert_equal(vec.values() == std::vector<pgvector::Half>{1, 2, 3}, true);
@@ -39,6 +44,7 @@ void test_halfvec() {
39
44
test_constructor_vector();
40
45
test_constructor_span();
41
46
test_constructor_empty();
47
+ test_dimensions();
42
48
test_values();
43
49
test_string();
50
test/sparsevec_test.cpp
@@ -50,6 +50,21 @@ static void test_constructor_empty() {
assert_equal(vec2.dimensions(), 0);
51
52
53
54
+ SparseVector vec{std::vector<float>{1, 0, 2, 0, 3, 0}};
55
+ assert_equal(vec.dimensions(), 6);
56
57
58
+static void test_indices() {
59
60
+ assert_equal(vec.indices() == std::vector<int>{0, 2, 4}, true);
61
62
63
+static void test_values() {
64
65
+ assert_equal(vec.values() == std::vector<float>{1, 2, 3}, true);
66
67
68
static void test_string() {
69
SparseVector vec{std::vector<float>{1, 0, 2, 0, 3, 0}};
70
std::ostringstream oss;
@@ -62,5 +77,8 @@ void test_sparsevec() {
77
78
79
test_constructor_map();
80
81
+ test_indices();
82
+ test_values();
83
84
test/vector_test.cpp
+ Vector vec{{1, 2, 3}};
Vector vec{{1, 2, 3}};
assert_equal(vec.values() == std::vector<float>{1, 2, 3}, true);
@@ -39,6 +44,7 @@ void test_vector() {
0 commit comments