use crate::qrcode::decoder::ErrorCorrectionLevel;
#[test]
fn testForBits() {
assert_eq!(
ErrorCorrectionLevel::M,
ErrorCorrectionLevel::forBits(0).unwrap()
);
assert_eq!(
ErrorCorrectionLevel::L,
ErrorCorrectionLevel::forBits(1).unwrap()
);
assert_eq!(
ErrorCorrectionLevel::H,
ErrorCorrectionLevel::forBits(2).unwrap()
);
assert_eq!(
ErrorCorrectionLevel::Q,
ErrorCorrectionLevel::forBits(3).unwrap()
);
}
#[test]
#[should_panic]
fn testBadECLevel() {
assert!(ErrorCorrectionLevel::forBits(4).is_ok());
}