-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add description for test vectors #69
Conversation
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.
PR LGTM as is, but regarding the other question:
-
I'd say Keeping tests 2/4/5 as-is is somewhat critical: the multitude of ways to implement leading zero preservation means this combination of testvectors is needed to weed out bugs. That is it doesn't matter what the string is, what is important is to have
string
\x00string
\x00\x00string
as a test vector. -
3 is likely there to support 6, I am in favor of removing it.
TLDR: we could get by with only keeping 4 tests:
string
\x00string
\x00\x00string
requiring full roundtrip by a compliant implementation- mangled-case-encoding requiring valid decode by a compliant implementation
Thanks @ribasushi, that's the reply I was looking for. I'm not deep enough into base encoding to understand why a different number of leading zeros makes a difference.
|
I changed my mind. I updated the descriptions and removed some test vectors. As files numbered with gaps is weird, I also renamed them. Please note that I didn't change the vectors themselves, so implementations (like js-multibase) don't need to update them, they can just remove some (if they want to, but don't have to). |
Why not just leave them? I believe they're just testing different strings and different lengths. |
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.
@Stebalien both @hugomrdias during implementation and @vmx just now had to raise a question "why are these things here, what do they accomplish?". I think reducing the amount of vectors and clearly naming them is an improvement. |
I guess it does: #71 |
There is no point of testing things that were already tested.
I've rebased on master, I think it's ready to be merged, please review again. |
I was looking at the test vectors (in order to add them to the Rust implementation). I think test vectors should always serve a purpose, hence I documented them in this README.
Though I couldn't make sense for all of them. Some seem to test exactly the same thing. Hence I propose removing some. I propose removing
test2.csv
,test3.csv
,test4.csv
as I don't see how they add value.