mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
fix issue encoding qrcode digit only data
This commit is contained in:
@@ -71,6 +71,17 @@ fn testGetAlphanumericCode() {
|
||||
assert_eq!(-1, encoder::getAlphanumericCode(b'\0' as u32));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_digits_only() {
|
||||
let test_data = "374833744734397449";
|
||||
let data = encoder::encode(test_data, ErrorCorrectionLevel::H).expect("encode");
|
||||
let decode = crate::qrcode::decoder::decoder::decode_bitmatrix(
|
||||
&data.getMatrix().as_ref().unwrap().clone().into(),
|
||||
)
|
||||
.expect("decode");
|
||||
assert_eq!(test_data, decode.getText());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn testChooseMode() {
|
||||
// Numeric Mode::
|
||||
|
||||
Reference in New Issue
Block a user