Skip to content

Commit

Permalink
Add failing test case for #231 (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey authored Jun 24, 2024
1 parent 56299ea commit dc7ea65
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/scenarios/Testing/00-ORDER.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ Achievements
1780-structure-merge-expansion
1533-sow-command.yaml
1533-sow-seed-maturation.yaml
231-requirements
1 change: 1 addition & 0 deletions data/scenarios/Testing/231-requirements/00-ORDER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
231-command-transformer-reqs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Foo
version: 1
description: |
A function transforming a command correctly accumulates requirements.
creative: false
solution: |
def pr = require 1 "rock"; move; place "rock" end
def x4 = \c. c;c;c;c end
build {x4 pr}
objectives:
- goal:
- Place four rocks
condition: |
judge <- robotNamed "judge";
as judge {ishere "rock"}
robots:
- name: base
loc: [0, 0]
dir: east
devices:
- 3D printer
- solar panel
inventory:
- [4, rock]
- [1, treads]
- [1, grabber]
- [1, solar panel]
- [1, lambda]
- name: judge
loc: [4, 0]
system: true
display:
invisible: true
world:
dsl: |
{grass}
1 change: 1 addition & 0 deletions swarm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ test-suite swarm-integration
lens,
mtl,
tasty >=0.10 && <1.6,
tasty-expected-failure >=0.12 && <0.13,
tasty-hunit >=0.10 && <0.11,
text,
witch,
Expand Down
3 changes: 3 additions & 0 deletions test/integration/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import Swarm.Util.Yaml (decodeFileEitherE)
import System.FilePath (splitDirectories)
import System.Timeout (timeout)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.ExpectedFailure (expectFailBecause)
import Test.Tasty.HUnit (Assertion, assertBool, assertEqual, assertFailure, testCase)
import Witch (into)

Expand Down Expand Up @@ -467,6 +468,8 @@ testScenarioSolutions rs ui =
assertEqual "Incorrect tangible command count." 7 $ view tangibleCommandCount counters
assertEqual "Incorrect command count." 10 $ sum . M.elems $ view commandsHistogram counters
assertEqual "Incorrect step count." 62 $ view lifetimeStepCount counters
, expectFailBecause "Awaiting fix for #231" $
testSolution Default "Testing/231-requirements/231-command-transformer-reqs"
]
where
-- expectFailIf :: Bool -> String -> TestTree -> TestTree
Expand Down

0 comments on commit dc7ea65

Please sign in to comment.