X-Git-Url: http://git.scottworley.com/planeteer/blobdiff_plain/ebe808f6f0fed968fc1949da25b4c869ec98abf5..a5a4d82482a774620eda5f0bfbbe26bec0074ff7:/planeteer_test.go?ds=sidebyside diff --git a/planeteer_test.go b/planeteer_test.go index 7661ad6..42baae0 100644 --- a/planeteer_test.go +++ b/planeteer_test.go @@ -17,3 +17,24 @@ func TestEncodeDecode(t *testing.T) { } } } + +func TestCommas(t *testing.T) { + cases := map[int32]string{ + 1: "1", + 10: "10", + 100: "100", + 1000: "1,000", + 10000: "10,000", + 100000: "100,000", + 1000000: "1,000,000", + 1234567: "1,234,567", + 1000567: "1,000,567", + 1234000: "1,234,000", + 525000: "525,000", + } + for n, s := range cases { + if Commas(n) != s { + t.Error(n, "not", s) + } + } +}