Skip to content

Conversation

plietar
Copy link

@plietar plietar commented Sep 8, 2025

The expect_vector function delegates most of its logic to vctrs::vec_assert, which can throw one of two errors, vctrs_error_assert and vctrs_error_scalar_type.

Only the former one was being handled, not the latter. This doesn't affect the behaviour of tests much, but it produces sub-par error messages and causes failing tests to terminate immediately rather than recording the error and continuing like other assertions do.

Fixes #2224

The `expect_vector` function delegates most of its logic to
`vctrs::vec_assert`, which can throw one of two errors,
`vctrs_error_assert` and `vctrs_error_scalar_type`.

Only the former one was being handled, not the latter. This doesn't
affect the behaviour of tests much, but it produces sub-par error
messages and causes failing tests to terminate immediately rather than
recording the error and continuing like other assertions do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expect_vector with NULL terminates the test prematurely
1 participant