-
-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rework to only allow single # in quoted strings * fix save() * fix state machine bug with exiting %s * Update skript-aliases * remove unreachable code --------- Co-authored-by: Moderocky <[email protected]>
- Loading branch information
Showing
28 changed files
with
298 additions
and
144 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
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
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,46 @@ | ||
test "comments": | ||
parse: | ||
set {_a} to {_b} # test | ||
assert last parse logs is not set with "skript should be able to handle inline comments but did not" | ||
|
||
|
||
parse: | ||
assert "a" is "a" with "wrong number of hashtags" | ||
assert "#a" is join "#", and "a" with "wrong number of hashtags" | ||
assert "##a" is join "#", "#", and "a" with "wrong number of hashtags" | ||
assert "###a" is join "#", "#", "#", and "a" with "wrong number of hashtags" | ||
assert last parse logs is not set with "skript should be able to handle strings any number of hashtags but did not" | ||
|
||
|
||
parse: | ||
assert "a%"#"%" is join "a", and "#" with "wrong number of hashtags" | ||
assert "#a%"#}"%" is join "#", "a", and "#}" with "wrong number of hashtags" | ||
assert "##a%"#"%" is join "#", "#", "a", and "#" with "wrong number of hashtags" | ||
assert "#{##a%"#"%" is join "#{", "#", "#", "a", and "#" with "wrong number of hashtags" | ||
assert last parse logs is not set with "skript should be able to handle complex strings any number of hashtags but did not" | ||
|
||
|
||
parse: | ||
set {_a} to "<#abcdef>test" | ||
set {_b} to "<##abcdef>test" | ||
assert uncoloured {_a} is "test" with "failed to parse single hashtag colour code" | ||
assert uncoloured {_b} is "test" with "failed to parse double hashtag colour code" | ||
assert last parse logs is not set with "skript should be able to handle hex colour codes but did not" | ||
|
||
parse: | ||
set {_a} to "###SH#JABJ#BJ#JB#K#BH#G#J##J#HJ%%KJB#JKK%%""%%""%%""%%#""##%%""#""%%##""#%""%##%"#"""%#"#!!""#""#L@$L@:@#L@K:L%@^$:"#^#:^J$%:K^J%&LK:#::&&^^^%%test | ||
assert last parse logs is not set with "skript should be able to handle very messy string but did not" | ||
|
||
|
||
parse: | ||
set {_a##} to "test" | ||
set {##_b} to "test" | ||
set {##_b::%"{}"%} to "test" | ||
set {##_b::%"{}#"%} to "#test" | ||
assert {##_b::%"{}#"%} is join "#" and "test" with "failed state machine check" | ||
assert last parse logs is not set with "skript should be able to handle hashtags in variable names but did not" | ||
|
||
|
||
parse: | ||
set {##_b::%"{}"#%} to "#test" | ||
assert last parse logs is set with "skript should not be able to handle hashtags in an expression in a variable name but did" |
12 changes: 6 additions & 6 deletions
12
src/test/skript/tests/regressions/4235-floating point errors rounding functions.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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
test "floating point errors in rounding functions": | ||
#assert ceil(100*0.07) is 7 with "ceil function doesn't adjust for floating point errors ##1" | ||
#assert ceil(100*0.033 - 0.3) is 3 with "ceil function doesn't adjust for floating point errors ##2" | ||
#assert ceil(100*0.07) is 7 with "ceil function doesn't adjust for floating point errors" | ||
#assert ceil(100*0.033 - 0.3) is 3 with "ceil function doesn't adjust for floating point errors" | ||
|
||
#assert rounded up 100*0.07 is 7 with "ceil expression doesn't adjust for floating point errors ##1" | ||
#assert rounded up 100*0.033 - 0.3 is 3 with "ceil expression doesn't adjust for floating point errors ##2" | ||
#assert rounded up 100*0.07 is 7 with "ceil expression doesn't adjust for floating point errors" | ||
#assert rounded up 100*0.033 - 0.3 is 3 with "ceil expression doesn't adjust for floating point errors" | ||
|
||
set {_sum} to 0 | ||
loop 100 times: | ||
add 0.1 to {_sum} | ||
assert floor({_sum}) is 10 with "floor function doesn't adjust for floating point errors ##1" | ||
assert rounded down {_sum} is 10 with "floor expression doesn't adjust for floating point errors ##1" | ||
assert floor({_sum}) is 10 with "floor function doesn't adjust for floating point errors" | ||
assert rounded down {_sum} is 10 with "floor expression doesn't adjust for floating point errors" |
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
14 changes: 7 additions & 7 deletions
14
src/test/skript/tests/regressions/535-math is done in the wrong order.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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
test "math order": | ||
assert 1 + 1 = 2 with "basic math ##1 failed" | ||
assert 5 - 3 = 2 with "basic math ##2 failed" | ||
assert 1 + 1 = 2 with "basic math failed" | ||
assert 5 - 3 = 2 with "basic math failed" | ||
|
||
assert 5 - 3 - 1 = 1 with "basic chained math ##1 failed" | ||
assert 5-3-2 = 0 with "basic chained math ##2 failed" | ||
assert 10 - 1 - 5 = 4 with "basic chained math ##3 failed" | ||
assert 5 - 3 - 1 = 1 with "basic chained math failed" | ||
assert 5-3-2 = 0 with "basic chained math failed" | ||
assert 10 - 1 - 5 = 4 with "basic chained math failed" | ||
|
||
assert (9 - 1) - 3 = 5 with "basic chained math with parentheses ##1 failed" | ||
assert 9 - (1 - 3) = 11 with "basic chained math with parentheses ##2 failed" | ||
assert (9 - 1) - 3 = 5 with "basic chained math with parentheses failed" | ||
assert 9 - (1 - 3) = 11 with "basic chained math with parentheses failed" |
Oops, something went wrong.