Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MrlnHi committed Apr 22, 2023
1 parent 782bb00 commit 12cc6b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions crates/valence_schem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ valence_block.workspace = true
valence_core.workspace = true
valence_instance.workspace = true
valence_nbt.workspace = true

[dev-dependencies]
valence.workspace = true
16 changes: 8 additions & 8 deletions crates/valence_schem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,16 +957,16 @@ impl Schematic {
mod test {
use std::fs;

use valence::prelude::*;
use valence_core::ident;

use super::*;

#[test]
fn schematic_copy_paste() {
let mut app = App::new();
app.add_plugin(ServerPlugin::new(()));
let mut instance = app
.world
.resource::<Server>()
.new_instance(DimensionId::default());
app.add_plugins(DefaultPlugins);
let mut instance = Instance::new_unit_testing(ident!("overworld"), app.world.resource());

for x in -1..=0 {
for z in -1..=0 {
Expand All @@ -981,7 +981,7 @@ mod test {
instance.set_block([6, 2, -1], BlockState::STONE);
instance.set_block(
[5, 3, -1],
Block::with_nbt(
ValenceBlock::with_nbt(
BlockState::OAK_SIGN,
compound! {"Text1" => "abc".into_text()},
),
Expand All @@ -997,7 +997,7 @@ mod test {
&instance,
(BlockPos::new(4, 3, -1), BlockPos::new(6, 1, 0)),
BlockPos::new(5, 3, 0),
|_| ident!("minecraft:plains"),
|_| ident!("minecraft:plains").to_string_ident(),
);

schematic.paste(&mut instance, BlockPos::new(15, 18, 16), |_| {
Expand Down Expand Up @@ -1068,7 +1068,7 @@ mod test {
"Data" => compound!{
"Text1" => "abc".into_text(),
},
"Id" => "sign",
"Id" => "minecraft:sign",
"Pos" => vec![1, 2, 0],
},
]))
Expand Down

0 comments on commit 12cc6b7

Please sign in to comment.