From 6d7aa23ee33cb9602367e0933e6eacc2101aff3b Mon Sep 17 00:00:00 2001 From: pcworld <0188801@gmail.com> Date: Sun, 29 Mar 2015 16:48:09 +0200 Subject: [PATCH] final2: movement of lazy ants created in between other lazy ants' moves --- src/final2/subtests/CreateTest.java | 58 ++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/src/final2/subtests/CreateTest.java b/src/final2/subtests/CreateTest.java index b95e42b..4f76eb0 100755 --- a/src/final2/subtests/CreateTest.java +++ b/src/final2/subtests/CreateTest.java @@ -15,7 +15,7 @@ * * @author Annika Berger * @author Roman Langrehr - * + * */ public class CreateTest extends LangtonSubtest { @@ -218,4 +218,60 @@ public void allTypesCreatedTest() { }; sessionTest(runs, Input.getFile(inputFile), ALL_TYPES_RULE, ALL_TYPES_SPEEDUP); } + + /** + * Asserts that each lazy ant has its own movement counter, i.e. a lazy ant created between other lazy ants' moves + * must move in a different rhythm than the other ants. + */ + @Test + public void testCreatedLazyAntMovement() { + inputFile = new String[] { + "y000", + "0000", + "0000", + "0000" + }; + runs = new Run[] { + checkPitch(inputFile), + move(1), + checkPitch(new String[] { + "0000", + "y000", + "0000", + "0000" + }), + new NoOutputRun("create z,2,2"), + checkPitch(new String[] { + "0000", + "y000", + "00z0", + "0000" + + }), + move(1), + checkPitch(new String[] { + "0000", + "y000", + "0000", + "00z0" + }), + move(1), + checkPitch(new String[] { + "0000", + "3y00", + "0000", + "00z0" + }), + move(1), + checkPitch(new String[] { + "0000", + "3y00", + "0000", + "003z" + }), + quit() + }; + sessionTest(runs, Input.getFile(inputFile), "rule=270-270-270-270-270", "speedup=2"); + } + }