mirror of
https://github.com/kmc7468/cs220.git
synced 2025-12-12 21:08:45 +00:00
@@ -13,7 +13,7 @@ pub(crate) fn add(lhs: usize, rhs: usize) -> usize {
|
||||
todo!()
|
||||
}
|
||||
|
||||
/// Adds two unsigned words. If underflow happens, just wrap around.
|
||||
/// Subtracts two unsigned words. If overflow happens, just wrap around.
|
||||
pub(crate) fn sub(lhs: usize, rhs: usize) -> usize {
|
||||
todo!()
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sub_underflow() {
|
||||
fn sub_overflow() {
|
||||
assert_eq!(sub(usize::MIN, 1), usize::MAX);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user