-
-
Notifications
You must be signed in to change notification settings - Fork 442
Add expr ai test #8061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add expr ai test #8061
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a8f26bb
add ExprAI tests
F1r3w477 f36564a
tab indent
F1r3w477 9266463
improve entity selection
F1r3w477 a532575
fix entity setting for multiple entities test
F1r3w477 2220e50
add missing edge case
F1r3w477 d9c733f
end in new line
F1r3w477 a070ace
add everyones suggestions
F1r3w477 a3008e9
entities to entity
F1r3w477 99548be
revert back to entites
F1r3w477 a90a0b5
additional suggestions and requests
F1r3w477 896edea
remove test for undefined behavior
F1r3w477 8f9789d
Merge branch 'dev/feature' into add-expr-ai-test
sovdeeth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,71 @@ | ||
| test "Entity AI Expression Functionality": | ||
| spawn a cow at test-location: | ||
| set {_cow} to entity | ||
|
|
||
| assert ai of {_cow} is true with "A cow's AI should be true by default" | ||
|
|
||
| set ai of {_cow} to false | ||
| assert ai of {_cow} is false with "AI should be set to false" | ||
|
|
||
| set ai of {_cow} to true | ||
| assert ai of {_cow} is true with "AI should be set back to true" | ||
|
|
||
| set {_cow}'s ai to false | ||
| assert {_cow}'s ai is false with "Possessive syntax setter should work" | ||
|
|
||
| set artificial intelligence of {_cow} to true | ||
| assert artificial intelligence of {_cow} is true with "Alias syntax setter should work" | ||
|
|
||
| set ai of {_cow} to no | ||
| assert ai of {_cow} is false with "'no' alias should set AI to false" | ||
| set ai of {_cow} to yes | ||
| assert ai of {_cow} is true with "'yes' alias should set AI to true" | ||
|
|
||
| clear entity within {_cow} | ||
|
|
||
| test "Entity AI with multiple entities": | ||
| spawn 2 cows at test-location | ||
| add entities to {_cows::*} | ||
|
|
||
| set ai of {_cows::*} to false | ||
| loop {_cows::*}: | ||
| assert ai of loop-value is false with "AI for all entities in a list should be set to false" | ||
|
|
||
| clear entities within {_cows::*} | ||
|
|
||
| test "Setting AI to an unset value": | ||
| spawn a cow at test-location: | ||
| set {_cow} to entity | ||
|
|
||
| clear {_undefined} | ||
| set ai of {_cow} to {_undefined} | ||
|
|
||
| assert ai of {_cow} is true with "Setting AI to an unset value should not change it" | ||
|
|
||
| clear entity within {_cow} | ||
|
|
||
| test "Getting AI of a dead entity": | ||
| spawn a cow at test-location: | ||
| set {_cow} to entity | ||
|
|
||
| clear entity within {_cow} | ||
|
|
||
| assert ai of {_cow} is true with "AI of a dead entity should report its last known state (true)" | ||
|
|
||
| test "Setting AI of a dead entity": | ||
| spawn a cow at test-location: | ||
| set {_cow} to entity | ||
|
|
||
| clear entity within {_cow} | ||
| set ai of {_cow} to false | ||
|
|
||
| assert ai of {_cow} is false with "It should be possible to set the AI of a dead entity" | ||
|
F1r3w477 marked this conversation as resolved.
Outdated
|
||
|
|
||
| test "Interacting with an undefined entity": | ||
| clear {_undefined} | ||
| clear {_value} | ||
|
F1r3w477 marked this conversation as resolved.
Outdated
|
||
|
|
||
| set ai of {_undefined} to false | ||
|
F1r3w477 marked this conversation as resolved.
Outdated
|
||
|
|
||
| set {_value} to ai of {_undefined} | ||
| assert {_value} is not set with "Getting the AI of an undefined entity should result in <none>" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.