test: validate encode/decode against official spec vectors#52
Conversation
…tive' into fix-issue-38-spec-vectors
|
Thanks for the great contribution, @sumanjeet0012! This PR is indeed a meaningful improvement to our conformance and regression testing. Aligning We particularly appreciate the dynamic discovery of the official CSV vectors and the clear distinction between canonical and non-canonical test cases, which keeps the test suite maintainable as the specification evolves. Using As those implementation issues are resolved, these expected failures will naturally transition into passing tests. It is also great to see that the entire CI matrix has passed successfully across multiple Python versions and platforms, giving additional confidence in the robustness of this change. Neat efforts for building a solid foundation for improving standards compliance and preventing future regressions. Excellent work, and thank you for putting this together. LGTM, happy to merge. CCing @acul71, @johannamoran and @mishmosh. |
Fixes #38
Description
This pull request adds
tests/test_spec_vectors.pywhich executes the official multibase test vectors natively from themultibase-specsubmodule (spec/tests/*.csv). This directly alignspy-multibase's regression test suite with the official specifications.Changes Made
csvfiles in the spec repository'stestsdirectory.canonical(encode + decode tested) ornon-canonical(decode tested only).ast.literal_eval.xfailwrapper around the core loop because these test vectors currently expose known bugs inpy-multibase(e.g.BaseStringConverterlosing leading zeros, base16 case-insensitivity bugs, etc.). This ensures the test suite safely introduces verification for passed encodings without instantly blocking CI builds.Verification
test_valuesaccurately intobytes.xfailedtests, which are correctly attributed to existing implementation gaps.make lintexecuted successfully.