Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 92ab707

Browse files
author
Orex
committed
fix test_checked_decimal_div_ko
1 parent f63bab9 commit 92ab707

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

programs/perpetuals/src/math.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,12 @@ mod tests {
448448
);
449449
}
450450

451+
#[test]
451452
fn test_checked_decimal_div_ko() {
452453
// Division by zero
453454
assert!(checked_decimal_div(1_000_000, -6, 0, -6, -6).is_err());
455+
456+
// Overflowing result
457+
assert!(checked_decimal_div(u64::MAX, -6, 1, -6, -6).is_err());
454458
}
455459
}

0 commit comments

Comments
 (0)