Skip to content

Commit 328d73f

Browse files
committed
add test to show the bugs
1 parent 4e63e5a commit 328d73f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

strconv/decimal.mbt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,16 @@ fn Decimal::to_string(self : Decimal) -> String {
601601
Show::to_string(self)
602602
}
603603
604+
test "from_int64" {
605+
let d = Decimal::from_int64(-1)
606+
inspect!(d.to_string(), content="0")
607+
}
608+
609+
test "to_string" {
610+
let d = parse_decimal!("-1")
611+
inspect!(d.to_string(), content="1")
612+
}
613+
604614
test "new" {
605615
let hpd = Decimal::from_int64(1L)
606616
assert_eq!(hpd.digits.length(), 800)

0 commit comments

Comments
 (0)