diff --git a/src/main.rs b/src/main.rs index acb80af..fbb2b49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,9 @@ mod storage; mod storage_server; use clap::Parser; +#[cfg(test)] +mod tests; + #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { diff --git a/src/storage/world.rs b/src/storage/world.rs index d34130f..bd5b411 100644 --- a/src/storage/world.rs +++ b/src/storage/world.rs @@ -14,6 +14,9 @@ struct ChunkSection { /// section contains a 16 x 16 x 16 cube of blocks = 4096 blocks /// If the section is empty, this is skipped block_count: u16, + /// The data for all the blocks in the chunk + /// The representation for this may be different based on the number of + /// non-empty blocks block_states: [BlockID; 4096], } diff --git a/src/tests/insert_one.rs b/src/tests/insert_one.rs new file mode 100644 index 0000000..70912be --- /dev/null +++ b/src/tests/insert_one.rs @@ -0,0 +1,7 @@ +#[cfg(test)] +mod tests { + #[test] + fn add_one_block() { + assert_eq!(1, 1); + } +} diff --git a/src/tests/mod.rs b/src/tests/mod.rs new file mode 100644 index 0000000..9d5f059 --- /dev/null +++ b/src/tests/mod.rs @@ -0,0 +1,2 @@ +mod insert_one; +