Ejemplo n.º 1
0
// Test the validation.
func TestValidation(t *testing.T) {
	assert := asserts.NewTestingAssertion(t, true)

	ec := 1
	messages := errors.Messages{ec: "valid"}
	err := errors.New(ec, messages)
	fileName, line, lerr := errors.Location(err)

	assert.True(errors.Valid(err))
	assert.Nil(lerr)
	assert.Equal(fileName, "errors_test.go")
	assert.Equal(line, 31)
}
Ejemplo n.º 2
0
// Test the validation.
func TestValidation(t *testing.T) {
	assert := asserts.NewTestingAssertion(t, true)

	ec := 1
	messages := errors.Messages{ec: "valid"}
	err := errors.New(ec, messages)
	packageName, fileName, line, lerr := errors.Location(err)

	assert.True(errors.Valid(err))
	assert.Nil(lerr)
	assert.Equal(packageName, "github.com/tideland/goas/v3/errors_test")
	assert.Equal(fileName, "errors_test.go")
	assert.Equal(line, 31)
}