publish lancet

This commit is contained in:
dudaodong committed 2021-11-28 21:28:23 +08:00
1 parent 37edb0fc8f
commit 3254591ab9
38 files changed
+5163

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package formatter
import (
"github.com/duke-git/lancet/utils"
"testing"
)
func TestComma(t *testing.T) {
comma(t, "", "","")
comma(t, "aa", "","")
comma(t, "123", "","123")
comma(t, "12345", "","12,345")
comma(t, 12345, "","12,345")
comma(t, 12345, "$","$12,345")
comma(t, 12345, "¥","¥12,345")
comma(t, 12345.6789, "","12,345.6789")
}
func comma(t *testing.T, test interface{}, symbol string, expected interface{}) {
res:= Comma(test, symbol)
if res != expected {
utils.LogFailedTestInfo(t, "Comma", test, expected, res)
t.FailNow()
}
}