Skip to content

Commit

Permalink
test: check which bar characters are allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Jul 17, 2023
1 parent ea5a43e commit 13495b4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ func TestValidators__isAlphanumeric(t *testing.T) {
}
}

func TestValidators__isAlphanumericExamples(t *testing.T) {
v := validator{}

validCases := []string{`|`}
for i := range validCases {
err := v.isAlphanumeric(validCases[i])
require.NoError(t, err, fmt.Sprintf("input: %q", validCases[i]))
}

invalidCases := []string{`¦`}
for i := range invalidCases {
err := v.isAlphanumeric(invalidCases[i])
require.ErrorIs(t, err, ErrNonAlphanumeric, fmt.Sprintf("input: %q", invalidCases[i]))
}
}

func TestValidators__validateJulianDay(t *testing.T) {
empty := " "
cases := map[string]string{
Expand Down

0 comments on commit 13495b4

Please sign in to comment.