rename bitmatrix test cases mod

This commit is contained in:
Henry Schimke
2023-01-11 16:02:26 -06:00
parent f037a743e7
commit fde23934f6
13 changed files with 51 additions and 32 deletions

View File

@@ -162,7 +162,7 @@ impl OneDimensionalCodeWriter for CodaBarWriter {
#[cfg(test)]
mod CodaBarWriterTestCase {
use crate::{
common::{BitMatrix, BitMatrixTestCase},
common::{bit_matrix_test_case, BitMatrix},
BarcodeFormat, Writer,
};
@@ -210,7 +210,7 @@ mod CodaBarWriterTestCase {
fn doTest(input: &str, expected: &str) {
let result = encode(input);
assert_eq!(expected, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(expected, bit_matrix_test_case::matrix_to_string(&result));
}
fn encode(input: &str) -> BitMatrix {

View File

@@ -37,7 +37,7 @@ use std::collections::HashMap;
use once_cell::sync::Lazy;
use crate::{
common::{BitMatrix, BitMatrixTestCase},
common::{bit_matrix_test_case, BitMatrix},
oned::{Code128Reader, OneDReader},
BarcodeFormat, EncodeHintType, EncodeHintValue, EncodingHintDictionary, Exceptions, Writer,
};
@@ -65,7 +65,7 @@ fn testEncodeWithFunc3() {
let result = encode(toEncode, false, "123").expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
let width = result.getWidth();
@@ -93,7 +93,7 @@ fn testEncodeWithFunc2() {
let result = encode(toEncode, false, "123").expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
let width = result.getWidth();
@@ -121,7 +121,7 @@ fn testEncodeWithFunc1() {
let result = encode(toEncode, false, "123").expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
let width = result.getWidth();
@@ -222,7 +222,7 @@ fn testEncodeWithFunc4() {
let result = encode(toEncode, false, "").expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
let width = result.getWidth();
@@ -250,7 +250,7 @@ fn testEncodeWithFncsAndNumberInCodesetA() {
let result = encode(toEncode, false, "").expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
@@ -310,7 +310,7 @@ fn testEncodeSwitchBetweenCodesetsAAndB() {
fn testEncode(toEncode: &str, expected: &str) {
let result = encode(toEncode, false, toEncode).expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual, "{}", toEncode);
let width = result.getWidth();
@@ -432,7 +432,7 @@ fn testEncodeWithForcedCodeSetFailureCodeSetA() {
.encode_with_hints(toEncode, &BarcodeFormat::CODE_128, 0, 0, &hints)
.expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
}
@@ -465,7 +465,7 @@ fn testEncodeWithForcedCodeSetFailureCodeSetB() {
.encode_with_hints(toEncode, &BarcodeFormat::CODE_128, 0, 0, &hints)
.expect("encode");
let actual = BitMatrixTestCase::matrix_to_string(&result);
let actual = bit_matrix_test_case::matrix_to_string(&result);
assert_eq!(expected, actual);
}

View File

@@ -174,7 +174,7 @@ impl Code39Writer {
* Tests {@link Code39Writer}.
*/
mod Code39WriterTestCase {
use crate::{common::BitMatrixTestCase, oned::Code39Writer, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, oned::Code39Writer, BarcodeFormat, Writer};
#[test]
fn testEncode() {
@@ -248,7 +248,7 @@ mod Code39WriterTestCase {
.expect("must encode");
assert_eq!(
expected,
BitMatrixTestCase::matrix_to_string(&result),
bit_matrix_test_case::matrix_to_string(&result),
"{}",
input
);

View File

@@ -212,7 +212,7 @@ impl Code93Writer {
*/
#[cfg(test)]
mod Code93WriterTestCase {
use crate::{common::BitMatrixTestCase, oned::Code93Writer, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, oned::Code93Writer, BarcodeFormat, Writer};
#[test]
fn testEncode() {
@@ -247,7 +247,7 @@ mod Code93WriterTestCase {
let result = Code93Writer::default()
.encode(input, &BarcodeFormat::CODE_93, 0, 0)
.expect("encode");
assert_eq!(expected, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(expected, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]

View File

@@ -135,7 +135,7 @@ const CODE_WIDTH: usize = 3 + // start guard
*/
#[cfg(test)]
mod EAN13WriterTestCase {
use crate::{common::BitMatrixTestCase, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, BarcodeFormat, Writer};
use super::EAN13Writer;
@@ -151,7 +151,7 @@ mod EAN13WriterTestCase {
0,
)
.expect("exist");
assert_eq!(testStr, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(testStr, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]
@@ -166,7 +166,7 @@ mod EAN13WriterTestCase {
0,
)
.expect("exist");
assert_eq!(testStr, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(testStr, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]

View File

@@ -120,7 +120,7 @@ impl OneDimensionalCodeWriter for EAN8Writer {
*/
#[cfg(test)]
mod EAN8WriterTestCase {
use crate::{common::BitMatrixTestCase, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, BarcodeFormat, Writer};
use super::EAN8Writer;
@@ -136,7 +136,7 @@ mod EAN8WriterTestCase {
0,
)
.expect("ok");
assert_eq!(testStr, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(testStr, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]
@@ -151,7 +151,7 @@ mod EAN8WriterTestCase {
0,
)
.expect("ok");
assert_eq!(testStr, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(testStr, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]

View File

@@ -97,7 +97,7 @@ const PATTERNS: [[usize; 5]; 10] = [
*/
#[cfg(test)]
mod ITFWriterTestCase {
use crate::{common::BitMatrixTestCase, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, BarcodeFormat, Writer};
use super::ITFWriter;
@@ -114,7 +114,7 @@ mod ITFWriterTestCase {
let result = ITFWriter::default()
.encode(input, &BarcodeFormat::ITF, 0, 0)
.expect("encode");
assert_eq!(expected, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(expected, bit_matrix_test_case::matrix_to_string(&result));
}
//@Test(expected = IllegalArgumentException.class)

View File

@@ -71,7 +71,7 @@ impl Writer for UPCAWriter {
*/
#[cfg(test)]
mod UPCAWriterTestCase {
use crate::{common::BitMatrixTestCase, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, BarcodeFormat, Writer};
use super::UPCAWriter;
@@ -87,7 +87,7 @@ mod UPCAWriterTestCase {
0,
)
.expect("ok");
assert_eq!(testStr, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(testStr, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]
@@ -102,6 +102,6 @@ mod UPCAWriterTestCase {
0,
)
.expect("ok");
assert_eq!(testStr, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(testStr, bit_matrix_test_case::matrix_to_string(&result));
}
}

View File

@@ -123,7 +123,7 @@ impl OneDimensionalCodeWriter for UPCEWriter {
*/
#[cfg(test)]
mod UPCEWriterTestCase {
use crate::{common::BitMatrixTestCase, BarcodeFormat, Writer};
use crate::{common::bit_matrix_test_case, BarcodeFormat, Writer};
use super::UPCEWriter;
@@ -160,7 +160,7 @@ mod UPCEWriterTestCase {
0,
)
.expect("ok");
assert_eq!(encoding, BitMatrixTestCase::matrix_to_string(&result));
assert_eq!(encoding, bit_matrix_test_case::matrix_to_string(&result));
}
#[test]