diff options
| author | mat <github@matdoes.dev> | 2021-12-18 17:02:23 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-18 17:02:23 -0600 |
| commit | 76e1985fc4ab21c43e17fef685b17a567b1073a5 (patch) | |
| tree | 8eb41443888a8d3d5c99e63121ed9189d5f224fe /azalea-nbt/tests | |
| parent | 428d0ee0e643676e47683c7d314cefebd03bf3f1 (diff) | |
| download | azalea-drasl-76e1985fc4ab21c43e17fef685b17a567b1073a5.tar.xz | |
reading nbt
Diffstat (limited to 'azalea-nbt/tests')
| -rw-r--r-- | azalea-nbt/tests/bigtest.nbt | bin | 0 -> 507 bytes | |||
| -rw-r--r-- | azalea-nbt/tests/decode.rs | 19 | ||||
| -rw-r--r-- | azalea-nbt/tests/hello_world.nbt | bin | 0 -> 33 bytes |
3 files changed, 19 insertions, 0 deletions
diff --git a/azalea-nbt/tests/bigtest.nbt b/azalea-nbt/tests/bigtest.nbt Binary files differnew file mode 100644 index 00000000..dc3769bc --- /dev/null +++ b/azalea-nbt/tests/bigtest.nbt diff --git a/azalea-nbt/tests/decode.rs b/azalea-nbt/tests/decode.rs new file mode 100644 index 00000000..f4060512 --- /dev/null +++ b/azalea-nbt/tests/decode.rs @@ -0,0 +1,19 @@ +use azalea_nbt::Tag; +use std::collections::HashMap; + +#[test] +fn test_hello_world() { + // read hello_world.nbt + let mut file = std::fs::File::open("tests/hello_world.nbt").unwrap(); + let tag = Tag::read(&mut file).unwrap(); + assert_eq!( + tag, + Tag::Compound(HashMap::from_iter(vec![( + "hello world".to_string(), + Tag::Compound(HashMap::from_iter(vec![( + "name".to_string(), + Tag::String("Bananrama".to_string()), + )])) + )])) + ); +} diff --git a/azalea-nbt/tests/hello_world.nbt b/azalea-nbt/tests/hello_world.nbt Binary files differnew file mode 100644 index 00000000..f3f5e21a --- /dev/null +++ b/azalea-nbt/tests/hello_world.nbt |
