make tests look a bit readable
This commit is contained in:
parent
2f7e21a657
commit
2ea94bfda4
28
src/ops.rs
28
src/ops.rs
|
|
@ -44,23 +44,23 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add() {
|
fn test_add() {
|
||||||
assert_eq!(F8::from(0b0011) + F8::from(0b0000), F8::from(0b0011));
|
assert_eq!(F8::from(3) + F8::from(0), F8::from(3));
|
||||||
assert_eq!(F8::from(0b0000) + F8::from(0b0111), F8::from(0b0111));
|
assert_eq!(F8::from(0) + F8::from(7), F8::from(7));
|
||||||
assert_eq!(F8::from(0b0011) + F8::from(0b0101), F8::from(0b1000));
|
assert_eq!(F8::from(3) + F8::from(5), F8::from(8));
|
||||||
assert_eq!(F8::from(0b0101) + F8::from(0b0011), F8::from(0b1000));
|
assert_eq!(F8::from(5) + F8::from(3), F8::from(8));
|
||||||
assert_eq!(F8::from(0b0011) + F8::from(0b0110), F8::from(0b1001));
|
assert_eq!(F8::from(3) + F8::from(6), F8::from(9));
|
||||||
assert_eq!(F8::from(0b0011) + F8::from(0b0111), F8::from(0b1010));
|
assert_eq!(F8::from(3) + F8::from(7), F8::from(10));
|
||||||
assert_eq!(F8::from(0b1100) + F8::from(0b0001), F8::from(0b1101));
|
assert_eq!(F8::from(12) + F8::from(1), F8::from(13));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sub() {
|
fn test_sub() {
|
||||||
assert_eq!(F8::from(0b0011) - F8::from(0b0000), F8::from(0b0011));
|
assert_eq!(F8::from(3) - F8::from(0), F8::from(3));
|
||||||
assert_eq!(F8::from(0b0000) - F8::from(0b0111), F8::from(0));
|
assert_eq!(F8::from(0) - F8::from(7), F8::from(0));
|
||||||
assert_eq!(F8::from(0b0011) - F8::from(0b0101), F8::from(0));
|
assert_eq!(F8::from(3) - F8::from(5), F8::from(0));
|
||||||
assert_eq!(F8::from(0b0101) - F8::from(0b0011), F8::from(0b0010));
|
assert_eq!(F8::from(5) - F8::from(3), F8::from(2));
|
||||||
assert_eq!(F8::from(0b0110) - F8::from(0b0011), F8::from(0b0011));
|
assert_eq!(F8::from(6) - F8::from(3), F8::from(3));
|
||||||
assert_eq!(F8::from(0b0111) - F8::from(0b0011), F8::from(0b0100));
|
assert_eq!(F8::from(7) - F8::from(3), F8::from(4));
|
||||||
assert_eq!(F8::from(0b1100) - F8::from(0b0001), F8::from(0b1011));
|
assert_eq!(F8::from(12) - F8::from(1), F8::from(11));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user