-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7535 from SkriptLang/dev/patch
Merge patch into feature.
- Loading branch information
Showing
12 changed files
with
168 additions
and
18 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
46 changes: 46 additions & 0 deletions
46
...t/java/org/skriptlang/skript/test/tests/regression/EffSendEffConnectConflict7517Test.java
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 @@ | ||
package org.skriptlang.skript.test.tests.regression; | ||
|
||
import ch.njol.skript.lang.Effect; | ||
import ch.njol.skript.lang.TriggerItem; | ||
import ch.njol.skript.lang.util.ContextlessEvent; | ||
import ch.njol.skript.test.runner.SkriptJUnitTest; | ||
import ch.njol.skript.variables.Variables; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.event.Event; | ||
import org.easymock.Capture; | ||
import org.easymock.EasyMock; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class EffSendEffConnectConflict7517Test extends SkriptJUnitTest { | ||
|
||
private static final String MESSAGE = "Hello, world!"; | ||
|
||
private CommandSender sender; | ||
private Effect sendEffect; | ||
|
||
@Before | ||
public void setup() { | ||
sender = EasyMock.niceMock(CommandSender.class); | ||
sendEffect = Effect.parse("send {_message} to {_sender}", null); | ||
if (sendEffect == null) | ||
throw new IllegalStateException(); | ||
} | ||
|
||
@Test | ||
public void test() { | ||
Event event = ContextlessEvent.get(); | ||
Variables.setVariable("sender", sender, event, true); | ||
Variables.setVariable("message", MESSAGE, event, true); | ||
|
||
Capture<String> messageCapture = EasyMock.newCapture(); | ||
sender.sendMessage(EasyMock.capture(messageCapture)); | ||
EasyMock.replay(sender); | ||
|
||
TriggerItem.walk(sendEffect, event); | ||
EasyMock.verify(sender); | ||
Assert.assertEquals(MESSAGE, messageCapture.getValue()); | ||
} | ||
|
||
} |
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 @@ | ||
using for each loops | ||
|
||
test "for each loops ending (start)": | ||
clear {7536 For Each::*} | ||
for each {_word} in ("test", "test2"): | ||
add {_word} to {7536 For Each::*} | ||
for each {_word 2} in ("example", "example2"): | ||
add {_word 2} to {7536 For Each::*} | ||
|
||
assert the size of {7536 For Each::*} is 6 with "Wrong number of variables: %{7536 For Each::*}%" | ||
|
||
# Need to make sure that trigger didn't just die | ||
test "for each loops ending (result)": | ||
assert the size of {7536 For Each::*} is 6 with "Wrong number of variables: %{7536 For Each::*}%" | ||
assert {7536 For Each::*} is ("test", "example", "example2", "test2", "example", "example2") with "Wrong loop order: %{7536 For Each::*}%" | ||
|
||
delete {7536 For Each::*} |
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