Skip to content

Commit

Permalink
add test to show the bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu-zh committed Feb 6, 2025
1 parent 4e63e5a commit 328d73f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions strconv/decimal.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,16 @@ fn Decimal::to_string(self : Decimal) -> String {
Show::to_string(self)
}

test "from_int64" {
let d = Decimal::from_int64(-1)
inspect!(d.to_string(), content="0")
}

test "to_string" {
let d = parse_decimal!("-1")
inspect!(d.to_string(), content="1")
}

test "new" {
let hpd = Decimal::from_int64(1L)
assert_eq!(hpd.digits.length(), 800)
Expand Down

0 comments on commit 328d73f

Please sign in to comment.