Skip to content

Commit

Permalink
test_const
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Jul 27, 2019
1 parent bfcb6ea commit a20e33d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib.rs
Expand Up @@ -2649,4 +2649,15 @@ mod test {
c.set_one();
assert!(c.is_one());
}

#[cfg(has_const_fn)]
#[test]
fn test_const() {
const R: f64 = 12.3;
const I: f64 = -4.5;
const C: Complex64 = Complex::new(R, I);

assert_eq!(C.re, 12.3);
assert_eq!(C.im, -4.5);
}
}

0 comments on commit a20e33d

Please sign in to comment.