mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-04 15:43:00 +00:00
@@ -22,6 +22,7 @@ import net.minecraft.world.level.block.RedstoneLampBlock
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Assertions.assertTrue
|
||||
import org.lwjgl.glfw.GLFW
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
class Computer_Test {
|
||||
/**
|
||||
@@ -71,6 +72,24 @@ class Computer_Test {
|
||||
thenExecute { context.assertBlockHas(lamp, RedstoneLampBlock.LIT, false, "Lamp should not be lit") }
|
||||
}
|
||||
|
||||
/**
|
||||
* Check computers pick up propagated redstone to surrounding blocks.
|
||||
*
|
||||
* @see [#1520](https://github.com/cc-tweaked/CC-Tweaked/issues/1520)
|
||||
*/
|
||||
@GameTest
|
||||
fun Self_output_update(context: GameTestHelper) = context.sequence {
|
||||
thenOnComputer {
|
||||
getApi<RedstoneAPI>().setOutput(ComputerSide.BACK, true)
|
||||
sleep(100.milliseconds)
|
||||
assertEquals(true, getApi<RedstoneAPI>().getInput(ComputerSide.BACK), "Input should be on")
|
||||
|
||||
getApi<RedstoneAPI>().setOutput(ComputerSide.BACK, false)
|
||||
sleep(100.milliseconds)
|
||||
assertEquals(false, getApi<RedstoneAPI>().getInput(ComputerSide.BACK), "Input should be off")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check computers and turtles expose peripherals.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user