-
Notifications
You must be signed in to change notification settings - Fork 2
test: ensure rust and cpp compression matches #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: ensure rust and cpp compression matches #32
Conversation
8ff21b3 to
dc87145
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
tests/test_data.rs
Outdated
| @@ -0,0 +1,45 @@ | |||
| #![cfg(all(feature = "rust", feature = "cpp"))] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its better to move this to tests/common.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tests/cpp_compat_tests.rs
Outdated
| ); | ||
| assert_eq!(decoded_cpp, decoded_by_rust); | ||
|
|
||
| for input in get_test_cases(512 + rust::BLOCK_SIZE_128 as usize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while totally not critical, and probably good for another PR, but it seems it might benefit us in the future to come up with some trait-based API that is the same for both rust and cpp implementation... ideas are welcome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agreed. For now, I need to apply a small workaround due to the interface between the rust-native implementation and the rust wrapper. A key issue is that the current rust-native code does not support arbitrary input lengths. The cpp implementation appears to tolerate such cases. I have added this to my to-do list once I better understand the algorithm.
nyurik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Implemented: