-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Add tests for item syntaxes. #6164
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5496978
Add 'with custom model data' test.
Moderocky f1e487c
Add 'amount of items' test.
Moderocky 987fe4c
Add 'items in' test.
Moderocky 441e716
Make safe for 1.13.2.
Moderocky 0d019b0
Merge branch 'dev/patch' into item-tests
Moderocky 8ee1711
Merge branch 'dev/patch' into item-tests
Moderocky 067612b
Update src/test/skript/tests/syntaxes/expressions/ExprItemsIn.sk
Moderocky e1e36eb
Merge branch 'dev/patch' into item-tests
sovdeeth 3423caf
Merge branch 'dev/patch' into item-tests
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
14 changes: 14 additions & 0 deletions
14
src/test/skript/tests/syntaxes/expressions/ExprAmountOfItems.sk
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,14 @@ | ||
test "amount of items": | ||
set {_inventory} to a hopper inventory named "test" | ||
assert the amount of stone in {_inventory} is 0 with "default amount failed" | ||
add stone to {_inventory} | ||
assert the amount of stone in {_inventory} is 1 with "single amount failed" | ||
add stone named "bread" to {_inventory} | ||
assert the amount of stone in {_inventory} is 2 with "different named items amount failed" | ||
add 100 of iron ingot to {_inventory} | ||
assert the amount of stone in {_inventory} is 2 with "add different item amount failed" | ||
assert the amount of iron ingot in {_inventory} is 100 with "add 100 item amount failed" | ||
remove stone from {_inventory} | ||
assert the amount of stone in {_inventory} is 1 with "removed one amount failed" | ||
remove stone from {_inventory} | ||
assert the amount of stone in {_inventory} is 0 with "removed all amount failed" |
13 changes: 13 additions & 0 deletions
13
src/test/skript/tests/syntaxes/expressions/ExprItemWithCustomModelData.sk
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,13 @@ | ||
test "item with custom model data" when minecraft version is not "1.13.2": | ||
set {_i} to stone | ||
assert the custom model data of {_i} is 0 with "default model data failed" | ||
set {_i} to stone with custom model data 5 | ||
assert the custom model data of {_i} is 5 with "simple model data set failed" | ||
set {_i} to stone with custom model data -1 | ||
assert the custom model data of {_i} is -1 with "negative model data set failed" | ||
set {_i} to {_i} with custom model data 2 | ||
assert the custom model data of {_i} is 2 with "existing item model data set failed" | ||
set {_i} to {_i} with custom model data 3.3 | ||
assert the custom model data of {_i} is 3 with "decimal item model data set failed" | ||
set {_i} to {_i} with custom model data 3.999 | ||
assert the custom model data of {_i} is 3 with "close decimal item model data set failed" |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.