-
Notifications
You must be signed in to change notification settings - Fork 33
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
Feature/test vector gen #248
Conversation
It seems that the function |
707ffa3
to
5e6391c
Compare
5e6391c
to
aa176a8
Compare
c1 := NewClaimAssignNameFromEntry(e) | ||
c2, err := NewClaimFromEntry(e) | ||
assert.Nil(t, err) | ||
assert.Equal(t, c0, c1) | ||
assert.Equal(t, c0, c2) | ||
// Stop test (write new test vector if needed) | ||
err = testgen.StopTest() |
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.
Recommended reading for @arnaubennassar:
// Avoids reinitializing tests | ||
var testInitialized = false | ||
|
||
func initializeTest() { |
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.
This is a perfect place for a test main. Let's do it in #249
assert.Nil(t, err) | ||
idj, err := json.Marshal(&id) | ||
assert.Nil(t, err) | ||
assert.Equal(t, `"11AVZrKNJVqDJoyKrdyaAgEynyBEjksV5z2NjZoPxf"`, string(idj)) | ||
|
||
testgen.CheckTestValue("idString2", strings.Replace(string(idj), "\"", "", 2), t) |
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.
Let's revisit this in the future, see if we can improve it.
Automate test vector generator.
At the moment this refactor only applies to the core package, but it's generic so it can be used for other packages.