-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix capability checking, and refactor/add lots of comments (#959)
Fixes #397. The only way I could understand this in order to fix it was to totally refactor the code and add lots of comments as I went. I feel like this is some of the most difficult code to wrap one's head around in the codebase. Hopefully now it's a bit easier to understand (though still not easy, I imagine).
- Loading branch information
Showing
4 changed files
with
127 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ | |
710-multi-robot.yaml | ||
920-meet.yaml | ||
955-heading.yaml | ||
397-wrong-missing.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: 1 | ||
name: Test issue 397 (wrong device reported missing) | ||
description: | | ||
A scenario designed to trigger issue 397, where in certain | ||
situations involving a capability with no candidate devices, | ||
an incorrect error message was generated reporting some other | ||
device to be missing. | ||
https://github.com/swarm-game/swarm/issues/397 | ||
objectives: | ||
- condition: | | ||
t <- time; return (t == 2) | ||
goal: | ||
- | | ||
This is a dummy condition that just ensures the base has had | ||
time to run the problematic `build` command. The scenario | ||
*should* generate an error message; what we really care about is | ||
whether the generated error message is correct, which is checked | ||
in test/integration/Main.hs . | ||
solution: | | ||
build {move; turn right; loc <- whereami} | ||
robots: | ||
- name: base | ||
dir: [0,1] | ||
devices: | ||
- 3D printer | ||
- logger | ||
inventory: | ||
- [1, treads] | ||
- [1, solar panel] | ||
world: | ||
default: [blank] | ||
palette: | ||
'Ω': [grass, null, base] | ||
'.': [grass] | ||
upperleft: [0,1] | ||
map: | | ||
. | ||
Ω |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters