mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-25 20:02:34 +00:00
Further test cases
This commit is contained in:
@@ -26,10 +26,10 @@ pub mod TelepenCommon {
|
||||
let temp = contents.chars().nth(i).unwrap() as u32;
|
||||
|
||||
if temp >= 27 {
|
||||
number.push_str(&(temp - 27).to_string());
|
||||
number.push_str(&format!("{:0>2}", (temp - 27)));
|
||||
}
|
||||
else {
|
||||
number.push_str(&(temp - 17).to_string());
|
||||
number.push_str(&format!("{:0>2}", (temp - 17)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
test_resources/blackbox/telepen-2/02.png
Normal file
BIN
test_resources/blackbox/telepen-2/02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 MiB |
1
test_resources/blackbox/telepen-2/02.txt
Normal file
1
test_resources/blackbox/telepen-2/02.txt
Normal file
@@ -0,0 +1 @@
|
||||
11058474
|
||||
BIN
test_resources/blackbox/telepen-2/03.png
Normal file
BIN
test_resources/blackbox/telepen-2/03.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 MiB |
1
test_resources/blackbox/telepen-2/03.txt
Normal file
1
test_resources/blackbox/telepen-2/03.txt
Normal file
@@ -0,0 +1 @@
|
||||
10398404
|
||||
BIN
test_resources/blackbox/telepen-2/04.png
Normal file
BIN
test_resources/blackbox/telepen-2/04.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 MiB |
1
test_resources/blackbox/telepen-2/04.txt
Normal file
1
test_resources/blackbox/telepen-2/04.txt
Normal file
@@ -0,0 +1 @@
|
||||
10483931
|
||||
BIN
test_resources/blackbox/telepen-2/05.png
Normal file
BIN
test_resources/blackbox/telepen-2/05.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
1
test_resources/blackbox/telepen-2/05.txt
Normal file
1
test_resources/blackbox/telepen-2/05.txt
Normal file
@@ -0,0 +1 @@
|
||||
11193263
|
||||
BIN
test_resources/blackbox/telepen-2/06.png
Normal file
BIN
test_resources/blackbox/telepen-2/06.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 MiB |
1
test_resources/blackbox/telepen-2/06.txt
Normal file
1
test_resources/blackbox/telepen-2/06.txt
Normal file
@@ -0,0 +1 @@
|
||||
11264314
|
||||
BIN
test_resources/blackbox/telepen-2/07.png
Normal file
BIN
test_resources/blackbox/telepen-2/07.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
1
test_resources/blackbox/telepen-2/07.txt
Normal file
1
test_resources/blackbox/telepen-2/07.txt
Normal file
@@ -0,0 +1 @@
|
||||
11188986
|
||||
@@ -45,7 +45,7 @@ fn telepen_numeric_test_case() {
|
||||
BarcodeFormat::TELEPEN,
|
||||
);
|
||||
|
||||
tester.add_test_complex(1, 1, 0, 0, 0.0);
|
||||
tester.add_test_complex(7, 1, 0, 0, 0.0);
|
||||
tester.add_hint(rxing::DecodeHintType::TELEPEN_AS_NUMERIC, rxing::DecodeHintValue::TelepenAsNumeric(true));
|
||||
tester.ignore_pure = true;
|
||||
|
||||
@@ -68,14 +68,22 @@ fn telepen_checksum_test2() {
|
||||
|
||||
#[test]
|
||||
fn telepen_alpha_to_numeric_test() {
|
||||
let ascii = "'=Siu";
|
||||
let result = TelepenCommon::ascii_to_numeric(ascii);
|
||||
let mut ascii = "'=Siu";
|
||||
let mut result = TelepenCommon::ascii_to_numeric(ascii);
|
||||
assert_eq!("1234567890", result);
|
||||
|
||||
ascii = "& oe";
|
||||
result = TelepenCommon::ascii_to_numeric(ascii);
|
||||
assert_eq!("11058474", result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn telepen_numeric_to_ascii_test() {
|
||||
let numeric = "1234567890";
|
||||
let result = TelepenCommon::numeric_to_ascii(numeric).unwrap();
|
||||
let mut numeric = "1234567890";
|
||||
let mut result = TelepenCommon::numeric_to_ascii(numeric).unwrap();
|
||||
assert_eq!("'=Siu", result);
|
||||
}
|
||||
|
||||
numeric = "11058474";
|
||||
result = TelepenCommon::numeric_to_ascii(numeric).unwrap();
|
||||
assert_eq!("& oe", result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user