From 7d64e16a30dca1feddaf954ec23bcfb4a51a162f Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Sun, 17 Sep 2023 17:38:10 -0700 Subject: [PATCH] add test --- data/scenarios/Testing/00-ORDER.txt | 1 + .../1536-custom-unwalkable-entities.yaml | 50 +++++++++++++++++++ test/integration/Main.hs | 1 + 3 files changed, 52 insertions(+) create mode 100644 data/scenarios/Testing/1536-custom-unwalkable-entities.yaml diff --git a/data/scenarios/Testing/00-ORDER.txt b/data/scenarios/Testing/00-ORDER.txt index 083ba630b..89f8a98e9 100644 --- a/data/scenarios/Testing/00-ORDER.txt +++ b/data/scenarios/Testing/00-ORDER.txt @@ -47,3 +47,4 @@ Achievements 1379-single-world-portal-reorientation.yaml 1399-backup-command.yaml 1430-built-robot-ownership.yaml +1536-custom-unwalkable-entities.yaml diff --git a/data/scenarios/Testing/1536-custom-unwalkable-entities.yaml b/data/scenarios/Testing/1536-custom-unwalkable-entities.yaml new file mode 100644 index 000000000..a2184438b --- /dev/null +++ b/data/scenarios/Testing/1536-custom-unwalkable-entities.yaml @@ -0,0 +1,50 @@ +version: 1 +name: Custom unwalkability +description: The base robot cannot walk through trees. + The scenario shall be failed if the robot + manages to walk through the tree by moving + three cells to the east. +objectives: + - goal: + - Get the flower + condition: | + as base {has "flower"}; + prerequisite: + not: has_bitcoin + - id: has_bitcoin + optional: true + goal: + - Do not get the bitcoin + condition: | + as base {has "bitcoin"}; +solution: | + def tryMove = try {move} {}; end; + tryMove; + tryMove; + tryMove; + grab; +robots: + - name: base + dir: [1, 0] + display: + attr: robot + devices: + - logger + - grabber + - treads + - dictionary + - net + unwalkable: + - tree +known: [tree, flower, bitcoin] +world: + palette: + 'B': [grass, null, base] + '.': [grass] + 'T': [grass, tree] + 'b': [grass, bitcoin] + 'f': [grass, flower] + upperleft: [0, 0] + map: | + BfTb + diff --git a/test/integration/Main.hs b/test/integration/Main.hs index 3901a4f57..ca8b54e89 100644 --- a/test/integration/Main.hs +++ b/test/integration/Main.hs @@ -333,6 +333,7 @@ testScenarioSolutions rs ui = , testSolution Default "Testing/1355-combustion" , testSolution Default "Testing/1379-single-world-portal-reorientation" , testSolution Default "Testing/1399-backup-command" + , testSolution Default "Testing/1536-custom-unwalkable-entities" , testGroup -- Note that the description of the classic world in -- data/worlds/classic.yaml (automatically tested to some