Skip to content
Permalink
Browse files
Clean log tests (#1202)
* Clean log tests

* Clean tests with dyn()
  • Loading branch information
Anatoliy057 committed May 31, 2020
1 parent eeb3b33 commit 3ef53379e3bc7057613e0bb9855568bfefe8a344
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
@@ -338,7 +338,7 @@ public void testExecute15() throws Exception {
@Test
public void testExecute16() throws Exception {
String script
= "proc('_myProc', @i, @j, @k, msg(trim(@i @j @k)))\n"
= "proc('_myProc', @i, @j, @k, msg(trim(\"@i @j @k\")))\n"
+ "_myProc()\n"
+ "_myProc(1)\n"
+ "_myProc(1, 2)\n"
@@ -736,7 +736,7 @@ public void testCompileErrorOfStaticConstructOptimization() throws Exception {
public void testLineNumberCorrectInException2() throws Exception {
String script
= "assign(@a, array(1, 2))\n" //Line 1
+ "\n" //Line 2
+ "@b = null\n" //Line 2
+ "assign(@d, @a[@b])\n"; //Line 3
try {
SRun(script, fakePlayer);
@@ -71,7 +71,7 @@ public void testCallProcIsProc() throws Exception {
+ " msg('hello world')"
+ " )"
+ " msg(is_proc('_proc'))"
+ " call_proc('_proc')"
+ " call_proc(dyn('_proc'))"
+ "<<<\n";
RunCommand(config, fakePlayer, "/for");
verify(fakePlayer).sendMessage("false");
@@ -116,8 +116,7 @@ public void testExportImportStringValue1() throws Exception {
public void testExportImportStringValue2() throws Exception {
when(fakePlayer.isOp()).thenReturn(Boolean.TRUE);
SRun("assign(@test, array(1, 2, 3))"
+ "export('myarray', @test)"
+ "msg(@newtest)", fakePlayer);
+ "export('myarray', @test)", fakePlayer);
SRun("assign(@newtest, import('myarray')) msg(@newtest)", fakePlayer);
verify(fakePlayer).sendMessage("{1, 2, 3}");
}
@@ -73,7 +73,9 @@ public void testRunas1() throws Exception {

@Test
public void testEval() throws Exception {
SRun("eval('msg(\\'Hello World!\\')')", fakePlayer);
String script
= "eval(dyn('msg(\\'Hello World!\\')'))";
SRun(script, fakePlayer);
verify(fakePlayer).sendMessage("Hello World!");
}

0 comments on commit 3ef5337

Please sign in to comment.