Browse Source

添加测试

yjp 8 months ago
parent
commit
95b39eea6d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      money/money_test.go

+ 6 - 0
money/money_test.go

@@ -9,3 +9,9 @@ func TestYuan2Fen(t *testing.T) {
 		t.Fatal("元转换为分错误")
 	}
 }
+
+func TestFen2Yuan(t *testing.T) {
+	if float32(Fen2Yuan(120)) != 1.2 {
+		t.Fatal("分转换为元错误")
+	}
+}