summaryrefslogtreecommitdiff
path: root/src/deserialise/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/deserialise/test.rs')
-rw-r--r--src/deserialise/test.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/deserialise/test.rs b/src/deserialise/test.rs
index fb95cc6..394ed64 100644
--- a/src/deserialise/test.rs
+++ b/src/deserialise/test.rs
@@ -19,18 +19,20 @@
// er General Public License along with bzipper. If
// not, see <https://www.gnu.org/licenses/>.
-use crate::deserialise::{Deserialise, DStream};
+use crate::{Deserialise, DStream, FixedString};
#[test]
-fn test_serialise() {
+fn test_deserialise() {
let data = [
0x00, 0xFF, 0xFF, 0x0F, 0xEF, 0x1F, 0xDF, 0x2F,
0xCF, 0x3F, 0xBF, 0x4F, 0xAF, 0x5F, 0x9F, 0x6F,
0x8F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x05, 0x00, 0x00, 0x03, 0xBB, 0x00, 0x00,
- 0x03, 0x91, 0x00, 0x00, 0x03, 0xBC, 0x00, 0x00,
- 0x03, 0x94, 0x00, 0x00, 0x03, 0xB1, 0x01, 0x00,
- 0x00, 0x01, 0x80,
+ 0x00, 0x09, 0x6D, 0xC3, 0xA1, 0x6E, 0x61, 0xC3,
+ 0xB0, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x03, 0xBB, 0x00,
+ 0x00, 0x03, 0x91, 0x00, 0x00, 0x03, 0xBC, 0x00,
+ 0x00, 0x03, 0x94, 0x00, 0x00, 0x03, 0xB1, 0x01,
+ 0x00, 0x00, 0x01, 0x80,
];
let mut stream = DStream::from(&data);
@@ -50,6 +52,11 @@ fn test_serialise() {
);
assert_eq!(
+ FixedString::<0x10>::deserialise(&mut stream).unwrap(),
+ "m\u{00E1}na\u{00F0}ur",
+ );
+
+ assert_eq!(
<[char; 0x5]>::deserialise(&mut stream).unwrap(),
['\u{03BB}', '\u{0391}', '\u{03BC}', '\u{0394}', '\u{03B1}'],
);