fastanvil 0.32.0

Minecraft Anvil library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{complete, JavaChunk};

const UNICODE_CHUNK: &[u8] = include_bytes!("../../resources/unicode.chunk");

#[test]
fn unicode_chunk() {
    // This chunk contains unicode that isn't on the basic multilingual plane.
    // Characters off this plane are encoded in a modified form of cesu8 which
    // is an encoding for unicode. Rust uses utf-8 for strings so there can be
    // conflicts if not deserialized properly.
    let c = JavaChunk::from_bytes(UNICODE_CHUNK);
    assert!(c.is_ok());
    let c = complete::Chunk::from_bytes(UNICODE_CHUNK);
    assert!(c.is_ok());
}