Skip to content

Commit a0e89e3

Browse files
committed
Added more tests
1 parent b1bba2d commit a0e89e3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/pqxx_test.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ void test_vector_from_string() {
173173
assert_exception<pqxx::conversion_error>([] {
174174
auto unused = pqxx::from_string<pgvector::Vector>("[4e38]");
175175
});
176+
177+
assert_exception<pqxx::conversion_error>([] {
178+
auto unused = pqxx::from_string<pgvector::Vector>("[,]");
179+
});
180+
181+
assert_exception<pqxx::conversion_error>([] {
182+
auto unused = pqxx::from_string<pgvector::Vector>("[1,]");
183+
});
176184
}
177185

178186
void test_halfvec_to_string() {
@@ -198,6 +206,18 @@ void test_halfvec_from_string() {
198206
assert_exception<pqxx::conversion_error>([] {
199207
auto unused = pqxx::from_string<pgvector::HalfVector>("[hello]");
200208
});
209+
210+
assert_exception<pqxx::conversion_error>([] {
211+
auto unused = pqxx::from_string<pgvector::HalfVector>("[4e38]");
212+
});
213+
214+
assert_exception<pqxx::conversion_error>([] {
215+
auto unused = pqxx::from_string<pgvector::HalfVector>("[,]");
216+
});
217+
218+
assert_exception<pqxx::conversion_error>([] {
219+
auto unused = pqxx::from_string<pgvector::HalfVector>("[1,]");
220+
});
201221
}
202222

203223
void test_sparsevec_to_string() {

0 commit comments

Comments
 (0)