forked from SkriptLang/Skript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple commands in EvtCommand and add tests
- Loading branch information
Showing
2 changed files
with
55 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
|
||
on command "testing1": | ||
add 1 to {evt-command::one command} | ||
|
||
|
||
on command "testing1 argument": | ||
add 1 to {evt-command::one command with argument} | ||
|
||
on command "testing1" or "testing2": | ||
add 1 to {evt-command::both} | ||
|
||
test "command event": | ||
execute console command "/testing1" | ||
execute console command "/testing1 argument" | ||
execute console command "/testing1 argument 2" | ||
execute console command "/testing2" | ||
execute console command "/testing2 argument" | ||
|
||
assert {evt-command::one command} is 3 with "testing1 command event triggered the wrong amount of times" | ||
assert {evt-command::one command with argument} is 2 with "testing1 argument command event triggered the wrong amount of times" | ||
assert {evt-command::both} is 5 with "testing1 or testing2 command event triggered the wrong amount of times" | ||
|
||
delete {evt-command::*} |