Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeezburga authored and Moderocky committed Aug 17, 2024
1 parent bf6a659 commit b6660a5
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions src/test/skript/tests/syntaxes/expressions/ExprDomestication.sk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ test "domestication":
spawn a zombie at (spawn of world "world"):
set {_z} to entity

# normal values, horse entity
set max domestication level of {_e} to 100
set domestication level of {_e} to 50
assert max domestication level of {_e} is 100 with "setting the max domestication of a horse should do exactly that"
Expand Down Expand Up @@ -39,18 +40,37 @@ test "domestication":
subtract 100 from max domestication level of {_e}
assert max domestication level of {_e} is 1 with "the max domestication level of a horse should never be less than 1"

# infinity values
add infinity value to max domestication level of {_e}
set max domestication level of {_e} to infinity value
add NaN value to max domestication level of {_e}
set max domestication level of {_e} to NaN value
assert max domestication level of {_e} is 1 with "infinity and NaN values affected the max domestication level of a horse, but shouldn't have"
assert max domestication level of {_e} is 1 with "infinity value shouldn't affect the max domestication level of a horse when added"
subtract infinity value from max domestication level of {_e}
assert max domestication level of {_e} is 1 with "infinity value should result in 1 when subtracted from the max domestication level of a horse"
set max domestication level of {_e} to infinity value # set is done last so the domestication level tests can also go to infinity
assert max domestication level of {_e} is 2147483647 with "infinity value should set the max domestication level of a horse to the max integer value"

add infinity value to domestication level of {_e}
assert domestication level of {_e} is 1 with "infinity value shouldn't affect the domestication level of a horse when added"
subtract infinity value from domestication level of {_e}
assert domestication level of {_e} is 1 with "infinity value should result in 1 when subtracted from the domestication level of a horse"
set domestication level of {_e} to infinity value
assert domestication level of {_e} is 2147483647 with "infinity value should set the domestication level of a horse to the max integer value"

# NaN values
add NaN value to max domestication level of {_e}
assert max domestication level of {_e} is 2147483647 with "NaN value should result in 2147483647 when added to the max domestication level of a horse"
set max domestication level of {_e} to NaN value
assert max domestication level of {_e} is 1 with "NaN value should result in 1 when used to set the max domestication level of a horse"
subtract NaN value from max domestication level of {_e}
assert max domestication level of {_e} is 1 with "NaN value should not allow the max domestication level of a horse to drop below 1"

add NaN value to domestication level of {_e}
assert domestication level of {_e} is 1 with "NaN value should result in 1 when used to change the domestication level of a horse"
set domestication level of {_e} to NaN value
assert domestication level of {_e} is 1 with "infinity and NaN values affected the domestication level of a horse, but shouldn't have"
assert domestication level of {_e} is 1 with "NaN value should result in 1 when used to set the domestication level of a horse"
subtract NaN value from domestication level of {_e}
assert domestication level of {_e} is 1 with "NaN value should result in 1 when used to change the domestication level of a horse"

# non-horse entity
assert max domestication level of {_z} is not set with "the max domestication of a non-horse should be null"
assert domestication level of {_z} is not set with "the domestication of a non-horse should be null"
set max domestication level of {_z} to 1
Expand Down

0 comments on commit b6660a5

Please sign in to comment.