+ #[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]));
+ }
+
+ #[test]
+ fn test_inc1() {
+ let mut b = BigInt::new(0);
+ b.inc1();
+ assert_eq!(b, BigInt::new(1));
+ b.inc1();
+ assert_eq!(b, BigInt::new(2));
+
+ b = BigInt::new(u64::MAX);
+ b.inc1();
+ assert_eq!(b, BigInt::from_vec(vec![0, 1]));
+ b.inc1();
+ assert_eq!(b, BigInt::from_vec(vec![1, 1]));
+ }
+