chore(rust): Add property-based tests for Scalar::cast_with_options
#25744
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to #23448.
First implementation of using
proptestto test core functionality. Tests were run with:cargo test --all-features -p polars-core test_scalar_castNested types were not included (yet), only simple types. 2 bugs were found, out-of-range date time values causing a panic and casting between Binary and BinaryOffset. These have been made into issues.
The rest of the tests pass:
Compiling polars-core v0.52.0 (/home/kevincp560/Projects/polars/crates/polars-core) Finished `test` profile [unoptimized + debuginfo] target(s) in 15.52s Running unittests src/lib.rs (/home/kevincp560/Projects/polars/target/debug/deps/polars_core-385d13635ce3c12b) running 2 tests test scalar::tests::test_scalar_cast_identity ... ok test scalar::tests::test_scalar_cast_with_options ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 162 filtered out; finished in 0.01sNumber of
proptestcases was put at 100, but can easily be increased/decreased.