-
-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for item syntaxes. (#6164)
* Add 'with custom model data' test. * Add 'amount of items' test. * Add 'items in' test. * Make safe for 1.13.2. * Update src/test/skript/tests/syntaxes/expressions/ExprItemsIn.sk Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> --------- Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
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