-// For the purpose of testing, one typically introduces a module called `tests` and tells the compiler
-// (by means of the `cfg` attribute) to only compile this module for tests.
-#[cfg(test)]
-mod tests {
- //@ If we added some functions here that are useful for testing, Rust would not bother compiling
- //@ them when you just build your program for normal use. Other than that, tests work as usually.
- #[test]
- fn test_add() {
- let b1 = BigInt::new(1 << 32);
- let b2 = BigInt::from_vec(vec![0, 1]);
-
- assert_eq!(&b1 + &b2, BigInt::from_vec(vec![1 << 32, 1]));
- // **Exercise 08.4**: Add some more testcases.
- }
-}
+// **Exercise 08.6**: Write a subtraction function, and testcases for it. Decide for yourself how you want to handle negative results.
+// For example, you may want to return an `Option`, to panic, or to return `0`.