package money import ( "testing" ) func TestYuan2Fen(t *testing.T) { if int(Yuan2Fen(1.2)) != 120 { t.Fatal("元转换为分错误") } } func TestFen2Yuan(t *testing.T) { if float32(Fen2Yuan(120)) != 1.2 { t.Fatal("分转换为元错误") } }