Skip to content

Commit

Permalink
chore: fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
noandrea committed May 14, 2021
1 parent 8e45c0c commit fea37be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/rosetta/lib/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@ func TestRegisterError(t *testing.T) {
var error *Error
// this is the number of errors registered by default in errors.go
registeredErrorsCount := 16
assert.Equal(t, len(registry.list()), registeredErrorsCount )
assert.Equal(t, len(registry.list()), registeredErrorsCount)
assert.ElementsMatch(t, registry.list(), ListErrors())
// add a new Error
error = RegisterError(69, "nice!", false, "nice!")
assert.NotNil(t, error)
// now we have a new error
registeredErrorsCount++
assert.Equal(t, len(ListErrors()), registeredErrorsCount )
assert.Equal(t, len(ListErrors()), registeredErrorsCount)
// re-register an error should not change anything
error = RegisterError(69, "nice!", false, "nice!")
assert.Equal(t, len(ListErrors()), registeredErrorsCount )
assert.Equal(t, len(ListErrors()), registeredErrorsCount)

// test sealing
assert.Equal(t, registry.sealed, false)
errors := SealAndListErrors()
assert.Equal(t, registry.sealed, true)
assert.Equal(t, len(errors), registeredErrorsCount )
assert.Equal(t, len(errors), registeredErrorsCount)
// add a new error on a sealed registry
error = RegisterError(1024, "bytes", false, "bytes")
assert.NotNil(t, error)


}

0 comments on commit fea37be

Please sign in to comment.