-
-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix ExprSortedList * Update src/main/java/ch/njol/skript/expressions/ExprSortedList.java Co-authored-by: LimeGlass <[email protected]> * Fix test Co-authored-by: Moderocky <[email protected]> --------- Co-authored-by: LimeGlass <[email protected]> Co-authored-by: Moderocky <[email protected]>
- Loading branch information
1 parent
5ba4dba
commit 8895157
Showing
2 changed files
with
38 additions
and
25 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
17 changes: 17 additions & 0 deletions
17
src/test/skript/tests/syntaxes/expressions/ExprSortedList.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,17 @@ | ||
test "sort": | ||
# Populate list | ||
set {_i} to 0 | ||
loop 5 times: | ||
set {_i} to {_i} + 1 | ||
set {_list::%{_i}%} to a random integer from 1 to 100 | ||
loop 5 times: | ||
set {_i} to {_i} + 1 | ||
set {_list::%{_i}%} to a random number from 1 to 100 | ||
|
||
# Test sorting | ||
loop sorted {_list::*}: | ||
if {_prev} is set: | ||
assert loop-value >= {_prev} with "Couldn't sort correctly" | ||
set {_prev} to loop-value | ||
|
||
assert (sorted 1 and "test") is not set with "Sorting incomparable values returned a value" |