price fixes
This commit is contained in:
parent
2940f00142
commit
8d81940faf
4 changed files with 66 additions and 47 deletions
|
|
@ -31,6 +31,11 @@ func TestParsePrice(t *testing.T) {
|
|||
if err != nil || p != 199 {
|
||||
t.Fatal(s, p)
|
||||
}
|
||||
s = "1,99"
|
||||
p, err = ParsePrice(s)
|
||||
if err != nil || p != 199 {
|
||||
t.Fatal(s, p)
|
||||
}
|
||||
s = "1123"
|
||||
p, err = ParsePrice(s)
|
||||
if err != nil || p != 112300 {
|
||||
|
|
@ -41,15 +46,4 @@ func TestParsePrice(t *testing.T) {
|
|||
if err == nil {
|
||||
t.Fatal(s, "should error")
|
||||
}
|
||||
s = "1123.3"
|
||||
_, err = ParsePrice(s)
|
||||
if err == nil {
|
||||
t.Fatal(s, "should error")
|
||||
}
|
||||
|
||||
s = "1123,33"
|
||||
_, err = ParsePrice(s)
|
||||
if err == nil {
|
||||
t.Fatal(s, "should error")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue