Skip to content

Commit a20e33d

Browse files
committed
test_const
1 parent bfcb6ea commit a20e33d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,4 +2649,15 @@ mod test {
26492649
c.set_one();
26502650
assert!(c.is_one());
26512651
}
2652+
2653+
#[cfg(has_const_fn)]
2654+
#[test]
2655+
fn test_const() {
2656+
const R: f64 = 12.3;
2657+
const I: f64 = -4.5;
2658+
const C: Complex64 = Complex::new(R, I);
2659+
2660+
assert_eq!(C.re, 12.3);
2661+
assert_eq!(C.im, -4.5);
2662+
}
26522663
}

0 commit comments

Comments
 (0)