Skip to content

Commit

Permalink
Add default decimal test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Mackenzie committed Mar 4, 2019
1 parent 166caa0 commit 6447c0d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions schema/number_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func TestCastNumber(t *testing.T) {
{"BareNumber_TrailingAtEndSpace", "95 %", 95, defaultDecimalChar, defaultGroupChar, notBareNumber},
{"GroupChar", "100,000", 100000, defaultDecimalChar, defaultGroupChar, defaultBareNumber},
{"DecimalChar", "95;10", 95.10, ";", defaultGroupChar, defaultBareNumber},
{"DecimalCharDefault", "95.10", 95.10, "", defaultGroupChar, defaultBareNumber},
{"Mix", "EUR 95;10", 95.10, ";", ";", notBareNumber},
}
for _, d := range data {
Expand Down Expand Up @@ -82,6 +83,7 @@ func TestCastNumber(t *testing.T) {
{"InvalidMaximum", "1", defaultDecimalChar, defaultGroupChar, notBareNumber, Constraints{Maximum: "boo"}},
{"NumSmallerThanMinimum", "1", defaultDecimalChar, defaultGroupChar, notBareNumber, Constraints{Minimum: "2"}},
{"InvalidMinimum", "1", defaultDecimalChar, defaultGroupChar, notBareNumber, Constraints{Minimum: "boo"}},
{"DecimalCharDefault", "95;10", "", defaultGroupChar, defaultBareNumber, Constraints{}},
}
for _, d := range data {
t.Run(d.desc, func(t *testing.T) {
Expand Down

0 comments on commit 6447c0d

Please sign in to comment.