mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
387 B
29 lines
387 B
4 years ago
|
use scalar::*;
|
||
|
|
||
|
#[test]
|
||
|
#[should_panic]
|
||
|
fn test_panic_sum() {
|
||
|
sum(25, 255);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
#[should_panic]
|
||
|
fn test_panic_diff() {
|
||
|
diff(-32768, 32766);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
#[should_panic]
|
||
|
fn test_panic_pro() {
|
||
|
pro(-128, 2);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn pass() {
|
||
|
assert_eq!(sum(1, 2), 3);
|
||
|
assert_eq!(diff(1, 2), -1);
|
||
|
assert_eq!(pro(1, 2), 2);
|
||
|
assert_eq!(quo(1.0, 2.0), 0.5);
|
||
|
assert_eq!(rem(1.0, 2.0), 1.0);
|
||
|
}
|