-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/patch' into patch/fixEffEnchant
- Loading branch information
Showing
6 changed files
with
143 additions
and
31 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
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
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
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
12 changes: 12 additions & 0 deletions
12
src/test/skript/tests/regressions/7159-regex exceptions not handled.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,12 @@ | ||
test "regex exceptions not handled": | ||
parse: | ||
set {_split::*} to regex split "test" at "\b{_name}\b" | ||
assert last parse logs is "'\b{_name}\b' is not a valid regular expression" with "regex split did not error with invalid regex literal" | ||
|
||
set {_pattern} to "\b{_name}\b" | ||
set {_split::*} to regex split "test" at {_pattern} | ||
assert {_split::*} is not set with "regex split returned a value with invalid regex expression" | ||
|
||
assert regex split "apple,banana;cherry" at "[,;]" is "apple", "banana" and "cherry" with "regex split did not split correctly with literal" | ||
set {_pattern} to "[,;]" | ||
assert regex split "apple,banana;cherry" at {_pattern} is "apple", "banana" and "cherry" with "regex split did not split correctly with expression" |
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,34 @@ | ||
test "long overflow, addition": | ||
set {_double-const} to 9000000000000000000.0 | ||
set {_long-const} to 9000000000000000000 | ||
|
||
loop 100 times: | ||
set {_double} to {_double} + {_double-const} | ||
set {_long} to {_long} + {_long-const} | ||
assert {_double} is {_long} with "long value did not overflow to a double" | ||
|
||
assert {_long} is 9000000000000000000 * 100.0 with "wrong final value" | ||
|
||
test "long underflow, subtraction": | ||
set {_double-const} to 9000000000000000000.0 | ||
set {_long-const} to 9000000000000000000 | ||
|
||
loop 100 times: | ||
set {_double} to {_double} - {_double-const} | ||
set {_long} to {_long} - {_long-const} | ||
assert {_double} is {_long} with "long value did not overflow to a double" | ||
|
||
assert {_long} is 9000000000000000000 * -100.0 with "wrong final value" | ||
|
||
test "long overflow, multiplication": | ||
set {_double} to 10.0 | ||
set {_long} to 10 | ||
|
||
loop 100 times: | ||
set {_double} to {_double} * 10 | ||
set {_long} to {_long} * 10 | ||
assert {_double} is {_long} with "long value did not overflow to a double" | ||
|
||
# the 6 is due to floating point error | ||
assert {_long} is 100000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000 with "wrong final value" | ||
|