Debian Codegraph @

src/tests/encode.rs

raw symbols SCIP
1 use craterust-analyzer cargo fast_qr 0.13.1 crate/::compactrust-analyzer cargo fast_qr 0.13.1 compact/::{CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#, KEEP_LASTrust-analyzer cargo fast_qr 0.13.1 compact/KEEP_LAST.};
2 use craterust-analyzer cargo fast_qr 0.13.1 crate/::encoderust-analyzer cargo fast_qr 0.13.1 encode/;
3 use craterust-analyzer cargo fast_qr 0.13.1 crate/::encoderust-analyzer cargo fast_qr 0.13.1 encode/::Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#;
4 use craterust-analyzer cargo fast_qr 0.13.1 crate/::hardcoderust-analyzer cargo fast_qr 0.13.1 hardcode/::cci_bitsrust-analyzer cargo fast_qr 0.13.1 hardcode/cci_bits().;
5
6 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
7 fn best_encoding_numeric_0rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_numeric_0().() {
8 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"589492");
9 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#, res);
10 }
11
12 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
13 fn best_encoding_numeric_1rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_numeric_1().() {
14 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"95904409521090298052194059450950249521940");
15 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#, res);
16 }
17
18 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
19 fn best_encoding_alnum_0rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_alnum_0().() {
20 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"HELLO WORLD");
21 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Alphanumericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Alphanumeric#, res);
22 }
23
24 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
25 fn best_encoding_alnum_1rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_alnum_1().() {
26 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"HELLO WORLD MY NAME IS ERWAN VIVIEN: THIS IS A TEST//////");
27 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Alphanumericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Alphanumeric#, res);
28 }
29
30 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
31 fn best_encoding_byte_0rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_byte_0().() {
32 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"589492h");
33 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Byterust-analyzer cargo fast_qr 0.13.1 encode/Mode#Byte#, res);
34 }
35
36 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
37 fn best_encoding_byte_1rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_byte_1().() {
38 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"HELLO WORLD!");
39 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Byterust-analyzer cargo fast_qr 0.13.1 encode/Mode#Byte#, res);
40 }
41
42 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
43 fn best_encoding_byte_2rust-analyzer cargo fast_qr 0.13.1 tests/encode/best_encoding_byte_2().() {
44 let res = encoderust-analyzer cargo fast_qr 0.13.1 encode/::best_encodingrust-analyzer cargo fast_qr 0.13.1 encode/best_encoding().(b"HELLO WORLD MY NAME, IS ERWAN VIVIEN: THIS IS A TEST//////");
45 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Byterust-analyzer cargo fast_qr 0.13.1 encode/Mode#Byte#, res);
46 }
47
48 fn test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(compact: &CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#, input: &[u8], expected_mode: Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#) {
49 let res = compact.get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().();
50 let mode = match res[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shr<i32>`]shr().4 {
51 0b0001 => Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#,
52 0b0010 => Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Alphanumericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Alphanumeric#,
53 0b0100 => Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Byterust-analyzer cargo fast_qr 0.13.1 encode/Mode#Byte#,
54 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("Invalid encoding mode"),
55 };
56
57 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
58 expected_mode, mode,
59 "Encoding mode should be {:?}",
60 expected_mode
61 );
62
63 let cci = cci_bitsrust-analyzer cargo fast_qr 0.13.1 hardcode/cci_bits().(craterust-analyzer cargo fast_qr 0.13.1 crate/::Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#::V01rust-analyzer cargo fast_qr 0.13.1 version/Version#V01#, mode) as u16;
64 let character_count: u16 = {
65 let first_nb_bits = 4;
66 let second_nb_bits = cci rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().first_nb_bits;
67
68 let first = ((res[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().0b0000_1111) as u16) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<Self>`]shl().second_nb_bits;
69 let second_mask = u8::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]MAX. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u16>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u16>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u16>`]shl().(8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().second_nb_bits);
70 let second = ((res[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().second_mask) as u16) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<Self>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<Self>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<Self>`]shr().(8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().second_nb_bits);
71
72 first rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().second
73 };
74
75 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
76 character_count,
77 input.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as u16,
78 "Input length, should be {}",
79 input.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()
80 );
81 }
82
83 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
84 fn encode_byte_1rust-analyzer cargo fast_qr 0.13.1 tests/encode/encode_byte_1().() {
85 let mut compact = CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#::newrust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]new().();
86 const INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT.: &[u8] = b"Hello WORLD!";
87 encoderust-analyzer cargo fast_qr 0.13.1 encode/::encode_byterust-analyzer cargo fast_qr 0.13.1 encode/encode_byte().(&mut compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., 8);
88
89 test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(&compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Byterust-analyzer cargo fast_qr 0.13.1 encode/Mode#Byte#);
90
91 let res = compact.get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().();
92 for (i, b) in INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
93 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). 0b111, *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().b >> 4, "Left part at index {}", i);
94 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). >> 4, *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().b &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). 0b1111, "Right part at index {}", i);
95 }
96 }
97
98 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
99 fn encode_alphanumeric_1rust-analyzer cargo fast_qr 0.13.1 tests/encode/encode_alphanumeric_1().() {
100 let mut compact = CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#::newrust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]new().();
101 const INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT.: &[u8] = b"HELLO WORLD";
102 encoderust-analyzer cargo fast_qr 0.13.1 encode/::encode_alphanumericrust-analyzer cargo fast_qr 0.13.1 encode/encode_alphanumeric().(&mut compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., 9);
103
104 test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(&compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Alphanumericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Alphanumeric#);
105
106 let keep_last = KEEP_LASTrust-analyzer cargo fast_qr 0.13.1 compact/KEEP_LAST..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`]map().(|x| x as u16);
107
108 let res = compact
109 .get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().()
110 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
111 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&x| u16::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`From<u8>`]from().(x))
112 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>();
113
114 // 13, 'HE'
115 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_0111, (17 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 14) >> 8);
116 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().2]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (17 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 14) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
117 // 24, 'LL'
118 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().3]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (21 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 21) >> 3);
119 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().4]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1110_0000, (21 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 21) << 5 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
120 // 35, 'O '
121 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().4]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0001_1111, (24 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 36) >> 6);
122 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().5]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1100, (24 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 36) << 2 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
123 // 46, 'WO'
124 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().5]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_0011, (32 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 24) >> 9);
125 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().6]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (32 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 24) >> 1 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
126 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().7]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1000_0000, (32 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 24) << 8 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
127 // 57, 'RL'
128 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().7]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0111_1111, (27 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 21) >> 4);
129 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().8]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_0000, (27 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 45 +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). 21) << 4 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
130 // 68, 'D'
131 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().8]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_1111, (13) >> 2);
132 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().9]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1100_0000, (13) << 6 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
133 }
134
135 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
136 fn encode_numeric_1rust-analyzer cargo fast_qr 0.13.1 tests/encode/encode_numeric_1().() {
137 let mut compact = CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#::newrust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]new().();
138 const INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT.: &[u8] = b"5894";
139 encoderust-analyzer cargo fast_qr 0.13.1 encode/::encode_numericrust-analyzer cargo fast_qr 0.13.1 encode/encode_numeric().(&mut compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., 10);
140
141 test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(&compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#);
142
143 let keep_last = KEEP_LASTrust-analyzer cargo fast_qr 0.13.1 compact/KEEP_LAST..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`]map().(|x| x as u16);
144
145 let res = compact
146 .get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().()
147 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
148 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&x| u16::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`From<u8>`]from().(x))
149 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>();
150
151 // 13, '589'
152 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_0011, 589 >> 8);
153 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().2]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (589 << 0) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
154 // 24, '4'
155 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().3]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_0000, (4 << 4) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
156 }
157
158 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
159 fn encode_numeric_2rust-analyzer cargo fast_qr 0.13.1 tests/encode/encode_numeric_2().() {
160 let mut compact = CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#::newrust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]new().();
161 const INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT.: &[u8] = b"58949";
162 encoderust-analyzer cargo fast_qr 0.13.1 encode/::encode_numericrust-analyzer cargo fast_qr 0.13.1 encode/encode_numeric().(&mut compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., 10);
163
164 test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(&compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#);
165
166 let keep_last = KEEP_LASTrust-analyzer cargo fast_qr 0.13.1 compact/KEEP_LAST..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`]map().(|x| x as u16);
167
168 let res = compact
169 .get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().()
170 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
171 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&x| u16::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`From<u8>`]from().(x))
172 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>();
173
174 // 13, '589'
175 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_0011, 589 >> 8);
176 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().2]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (589 << 0) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
177 // 24, '49'
178 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().3]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1110, 49 << 1 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
179 }
180
181 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
182 fn encode_numeric_3rust-analyzer cargo fast_qr 0.13.1 tests/encode/encode_numeric_3().() {
183 let mut compact = CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#::newrust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]new().();
184 const INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT.: &[u8] = b"589491";
185 encoderust-analyzer cargo fast_qr 0.13.1 encode/::encode_numericrust-analyzer cargo fast_qr 0.13.1 encode/encode_numeric().(&mut compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., 10);
186
187 test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(&compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#);
188
189 let keep_last = KEEP_LASTrust-analyzer cargo fast_qr 0.13.1 compact/KEEP_LAST..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`]map().(|x| x as u16);
190
191 let res = compact
192 .get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().()
193 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
194 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&x| u16::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`From<u8>`]from().(x))
195 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>();
196
197 // 13, '589'
198 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_0011, 589 >> 8);
199 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().2]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (589 << 0) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
200 // 24, '491'
201 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().3]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (491 >> 2) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
202 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().4]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1100_0000, (491 << 6) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
203 }
204
205 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
206 fn encode_numeric_4rust-analyzer cargo fast_qr 0.13.1 tests/encode/encode_numeric_4().() {
207 let mut compact = CompactQRrust-analyzer cargo fast_qr 0.13.1 compact/CompactQR#::newrust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]new().();
208 const INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT.: &[u8] = b"200505150001";
209 encoderust-analyzer cargo fast_qr 0.13.1 encode/::encode_numericrust-analyzer cargo fast_qr 0.13.1 encode/encode_numeric().(&mut compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., 10);
210
211 test_encode_headerrust-analyzer cargo fast_qr 0.13.1 tests/encode/test_encode_header().(&compact, INPUTrust-analyzer cargo fast_qr 0.13.1 tests/encode/INPUT., Moderust-analyzer cargo fast_qr 0.13.1 encode/Mode#::Numericrust-analyzer cargo fast_qr 0.13.1 encode/Mode#Numeric#);
212
213 let keep_last = KEEP_LASTrust-analyzer cargo fast_qr 0.13.1 compact/KEEP_LAST..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`]map().(|x| x as u16);
214
215 let res = compact
216 .get_datarust-analyzer cargo fast_qr 0.13.1 compact/impl#[CompactQR]get_data().()
217 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
218 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&x| u16::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`From<u8>`]from().(x))
219 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>();
220
221 // 13, '200'
222 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_0011, 200 >> 8);
223 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().2]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (200 << 0) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
224 // 24, '505'
225 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().3]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1111, (505 >> 2) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
226 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().4]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1100_0000, (505 << 6) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
227 // 35, '150'
228 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().4]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0011_1111, (150 >> 4) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
229 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().5]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_0000, (150 << 4) &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
230 // 46, '001'
231 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().5]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b0000_1111, (1) >> 6);
232 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().6]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). 0b1111_1100, (1) << 2 &rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). keep_last[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
233 }