1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
use crate::oned::rss::expanded::{binary_util, decoders::abstract_expanded_decoder::createDecoder};
#[allow(dead_code)]
pub const NUMERIC10: &str = "..X..XX";
#[allow(dead_code)]
pub const NUMERIC12: &str = "..X.X.X";
#[allow(dead_code)]
pub const NUMERIC1_FNC1: &str = "..XXX.X";
#[allow(dead_code)]
pub const NUMERIC2ALPHA: &str = "....";
#[allow(dead_code)]
pub const ALPHA_A: &str = "X.....";
#[allow(dead_code)]
pub const ALPHA_FNC1: &str = ".XXXX";
#[allow(dead_code)]
pub const ALPHA2NUMERIC: &str = "...";
#[allow(dead_code)]
pub const ALPHA2ISOIEC646: &str = "..X..";
#[allow(dead_code)]
pub const I646_B: &str = "X.....X";
#[allow(dead_code)]
pub const I646_C: &str = "X....X.";
#[allow(dead_code)]
pub const I646_FNC1: &str = ".XXXX";
#[allow(dead_code)]
pub const ISOIEC6462ALPHA: &str = "..X..";
#[allow(dead_code)]
pub const COMPRESSED_GTIN900123456798908: &str = ".........X..XXX.X.X.X...XX.XXXXX.XXXX.X.";
#[allow(dead_code)]
pub const COMPRESSED_GTIN900000000000008: &str = "........................................";
#[allow(dead_code)]
pub const COMPRESSED15BIT_WEIGHT1750: &str = "....XX.XX.X.XX.";
#[allow(dead_code)]
pub const COMPRESSED15BIT_WEIGHT11750: &str = ".X.XX.XXXX..XX.";
#[allow(dead_code)]
pub const COMPRESSED15BIT_WEIGHT0: &str = "...............";
#[allow(dead_code)]
pub const COMPRESSED20BIT_WEIGHT1750: &str = ".........XX.XX.X.XX.";
#[allow(dead_code)]
pub const COMPRESSED_DATE_MARCH12TH2010: &str = "....XXXX.X..XX..";
#[allow(dead_code)]
pub const COMPRESSED_DATE_END: &str = "X..X.XX.........";
#[allow(dead_code)]
pub fn assertCorrectBinaryString(binaryString: &str, expectedNumber: &str) {
let binary = binary_util::buildBitArrayFromStringWithoutSpaces(binaryString).expect("built");
let mut decoder = createDecoder(&binary).expect("get decoder");
let result = decoder.parseInformation().expect("information exists");
assert_eq!(expectedNumber, result);
}