Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/test-skripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,22 @@ jobs:

set {_tests::*} to all tests
autorun {_tests::*}

devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 parse section":
parse:
abc
assert last parse logs contains "Can't understand this condition/effect: abc"
EOF

- name: Run tests
uses: devdinc/skript-test-action@v1.3
uses: SkriptLang/skript-test-action@v1.3
with:
skript_repo_url: https://github.com/SkriptLang/Skript.git
# directory where your test scripts are located (relative to repo root)
test_script_directory: tests

# Skript version or ref (tag, branch, or commit)
skript_repo_ref: 2.15.0-pre1
skript_repo_ref: 2.15.0

# directory containing addon/plugin jars (relative to repo root)
extra_plugins_directory: build/libs
Expand Down
6 changes: 4 additions & 2 deletions scripts/libs/functionsv2.sk
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ condition set %object% to [new] lambda[ %-objects%](1:|2:-|3:+):
loop {_functionsv2.sk::ctx::nodes::*}:
set {_functionsv2.sk::ctx::indent} to loop-value.[Node]getIndentation().substring(length of {_functionsv2.sk::ctx::originindent} + 4) if {_functionsv2.sk::ctx::originindent} starts with " " else loop-value.[Node]getIndentation().substring(length of {_functionsv2.sk::ctx::originindent} + 1)
set {_functionsv2.sk::ctx::key} to "%{_functionsv2.sk::ctx::indent}%%loop-value.getKey()%"
set {_functionsv2.sk::ctx::key} to "%{_functionsv2.sk::ctx::key}%:" if loop-value is instance of SectionNode
if loop-value is instance of SectionNode:
set {_functionsv2.sk::ctx::key} to "%{_functionsv2.sk::ctx::key}%:"
add {_functionsv2.sk::ctx::key} to {_functionsv2.sk::ctx::expr::*}
{_functionsv2.sk::ctx::key}.trim() starts with "return"
set {_functionsv2.sk::ctx::noreturn} to false if parse mark is 1
Expand All @@ -176,7 +177,8 @@ condition set %object% to [new] (1:supplier|1:getter|2:runnable|2:runner|3:consu
loop {_functionsv2.sk::ctx::nodes::*}:
set {_functionsv2.sk::ctx::indent} to loop-value.[Node]getIndentation().substring(length of {_functionsv2.sk::ctx::originindent} + 4) if {_functionsv2.sk::ctx::originindent} starts with " " else loop-value.[Node]getIndentation().substring(length of {_functionsv2.sk::ctx::originindent} + 1)
set {_functionsv2.sk::ctx::key} to "%{_functionsv2.sk::ctx::indent}%%loop-value.getKey()%"
set {_functionsv2.sk::ctx::key} to "%{_functionsv2.sk::ctx::key}%:" if loop-value is instance of SectionNode
if loop-value is instance of SectionNode:
set {_functionsv2.sk::ctx::key} to "%{_functionsv2.sk::ctx::key}%:"
add {_functionsv2.sk::ctx::key} to {_functionsv2.sk::ctx::expr::*}

set {_functionsv2.sk::ctx::args::*} to FextractArgs({_functionsv2.sk::ctx::vars})
Expand Down
6 changes: 3 additions & 3 deletions scripts/utils/testframework.sk
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ effect:
then:
if parse tags does not contain "5":
sendTestFailMessage "Test ""%{_test}%"" with condition '%{_label}%: %{_raw}%' failed", expr-1
TestTracker.testFailed(expr-1)
TestTracker.testFailed("Test ""%{_test}%"" with condition '%{_label}%: %{_raw}%' failed", {_script})
add "%expr-1%" to {-test.sk::errors::%{_script}%.%{_test}%::*}
if parse tags contains "3":
delay effect
Expand All @@ -223,7 +223,7 @@ effect (3:|4:(no|without) (halt[ing]|fail[(-| )](safe|fast)|abort[ing])) fail te
set {_script} to event.getEventValue("script")
if parse tags does not contain "5":
sendTestFailMessage "Test ""%{_test}%"" failed", expr-1
TestTracker.testFailed(expr-1)
TestTracker.testFailed("Test ""%{_test}%"" with condition '%{_label}%: %{_raw}%' failed", {_script})
add "%expr-1%" to {-test.sk::errors::%{_script}%.%{_test}%::*}
if parse tags contains "3":
delay effect
Expand Down Expand Up @@ -277,7 +277,7 @@ condition parse:
{_logger}.close()
{_parser}.reset()

plural expression last parse logs:
plural expression (last|latest) parse logs:
usable in:
custom event "skriptTest"
get:
Expand Down
10 changes: 0 additions & 10 deletions tests/working/utils/testframework.test.sk
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
local effect no errors\: <.+>:
trigger:
stop

devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 assert true passes":
assert true: {_none} is not set

Expand All @@ -13,7 +9,6 @@ devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 framework internal consistenc
without halting assert true: "%current script%" is set
assert true: size of test errors is 0


devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 assert true failure is recorded":
without halting assert true with no error message: {_none} is set
assert true: size of test errors is 1
Expand Down Expand Up @@ -90,11 +85,6 @@ devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 test-block is temporary A":
devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 test-block is temporary B":
assert true: {-test.sk::temptestblocka} is test-block's type
assert true: {-test.sk::temptestblocka} is not {-test.sk::temptestblockb}

devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 parse section":
parse:
no errors: abc # just an internal stuff to make sure test.sk loads without errors
assert last parse logs contains "Can't understand this condition/effect: no errors: abc"

devdinc test "f39f0f4a-31ee-4b71-87e9-38ddba3a2313 last test result A":
fail test with no error message
Expand Down
Loading