You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
401 B

  1. package config_test
  2. import (
  3. "errors"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. "gopkg.in/go-playground/validator.v9"
  7. "gerrit.wikimedia.org/r/blubber/config"
  8. )
  9. func TestIsValidationError(t *testing.T) {
  10. assert.False(t, config.IsValidationError(nil))
  11. assert.False(t, config.IsValidationError(errors.New("foo")))
  12. assert.True(t, config.IsValidationError(validator.ValidationErrors{}))
  13. }