32 lines
No EOL
467 B
Rust
32 lines
No EOL
467 B
Rust
|
|
|
|
|
|
#![allow(unused_imports)]
|
|
#![allow(unused_variables)]
|
|
#![allow(dead_code)]
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
|
|
fn test_abs_positive() {
|
|
assert_eq!(42_i64.abs(), 42);
|
|
assert_eq!(3.14_f64.abs(), 3.14);
|
|
}
|
|
|
|
#[test]
|
|
|
|
|
|
fn test_abs_negative() {
|
|
assert_eq!((-42_i64).abs(), 42);
|
|
assert_eq!((-3.14_f64).abs(), 3.14);
|
|
}
|
|
|
|
#[test]
|
|
|
|
|
|
fn test_abs_zero() {
|
|
assert_eq!(0_i64.abs(), 0);
|
|
assert_eq!(0.0_f64.abs(), 0.0);
|
|
} |