From 6e2d2114339c50cd0c5efde34b6c508003cfb768 Mon Sep 17 00:00:00 2001 From: StackDoubleFlow Date: Mon, 16 Sep 2024 23:02:22 -0400 Subject: [PATCH] tests: include backend information when assert fails --- tests/common/mod.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 929a81c9..4e9f832d 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -123,19 +123,11 @@ impl World for TestWorld { } struct RedpilerInstance { - variant: BackendVariant, options: CompilerOptions, world: TestWorld, compiler: Compiler, } -impl RedpilerInstance { - fn tick(&mut self) { - self.compiler.tick(); - self.compiler.flush(&mut self.world); - } -} - pub struct AllBackendRunner { redstone_world: TestWorld, redpilers: Vec, @@ -158,7 +150,6 @@ impl AllBackendRunner { let ticks = world.to_be_ticked.clone(); compiler.compile(&world, bounds, options.clone(), ticks, monitor); RedpilerInstance { - variant, options, world: world.clone(), compiler, @@ -214,12 +205,15 @@ impl AllBackendRunner { pub fn check_block_powered(&self, pos: BlockPos, powered: bool) { assert_eq!( is_block_powered(self.redstone_world.get_block(pos)), - Some(powered) + Some(powered), + "when testing with the base redstone implementation" ); for redpiler in &self.redpilers { assert_eq!( is_block_powered(redpiler.world.get_block(pos)), - Some(powered) + Some(powered), + "when testing on redpiler options: {:#?}", + redpiler.options ); } }