@@ -144,7 +144,7 @@ void test_vector_to_string() {
144144 assert_equal (pqxx::to_string (pgvector::Vector ({-1.234567890123 })), " [-1.2345679]" );
145145
146146 assert_exception<pqxx::conversion_overrun>([] {
147- auto unused = pqxx::to_string (pgvector::Vector (std::vector<float >(16001 )));
147+ pqxx::to_string (pgvector::Vector (std::vector<float >(16001 )));
148148 }, " vector cannot have more than 16000 dimensions" );
149149}
150150
@@ -182,7 +182,7 @@ void test_halfvec_to_string() {
182182 assert_equal (pqxx::to_string (pgvector::HalfVector ({-1.234567890123 })), " [-1.2345679]" );
183183
184184 assert_exception<pqxx::conversion_overrun>([] {
185- auto unused = pqxx::to_string (pgvector::HalfVector (std::vector<float >(16001 )));
185+ pqxx::to_string (pgvector::HalfVector (std::vector<float >(16001 )));
186186 }, " halfvec cannot have more than 16000 dimensions" );
187187}
188188
@@ -219,6 +219,10 @@ void test_sparsevec_to_string() {
219219 assert_equal (pqxx::to_string (pgvector::SparseVector ({1 , 0 , 2 , 0 , 3 , 0 })), " {1:1,3:2,5:3}/6" );
220220 std::unordered_map<int , float > map = {{999999999 , -1.234567890123 }};
221221 assert_equal (pqxx::to_string (pgvector::SparseVector (map, 1000000000 )), " {1000000000:-1.2345679}/1000000000" );
222+
223+ assert_exception<pqxx::conversion_overrun>([] {
224+ pqxx::to_string (pgvector::SparseVector (std::vector<float >(16001 , 1 )));
225+ }, " sparsevec cannot have more than 16000 dimensions" );
222226}
223227
224228void test_sparsevec_from_string () {
@@ -272,10 +276,6 @@ void test_sparsevec_from_string() {
272276 assert_exception<pqxx::conversion_error>([] {
273277 auto unused = pqxx::from_string<pgvector::SparseVector>(" {}/a" );
274278 }, " Could not convert 'a' to int: Invalid argument." );
275-
276- assert_exception<pqxx::conversion_overrun>([] {
277- auto unused = pqxx::to_string (pgvector::SparseVector (std::vector<float >(16001 , 1 )));
278- }, " sparsevec cannot have more than 16000 dimensions" );
279279}
280280
281281void test_pqxx () {
0 commit comments