Browse Source

Fix missing assertions in tests

kindlich 4 years ago
parent
commit
2a5f279c6e
No known key found for this signature in database

+ 3
- 1
ScriptingExample/src/test/java/org/openzen/zenscript/scriptingexample/tests/actual_test/HelloWorldTest.java View File

9
     public void helloWorld() {
9
     public void helloWorld() {
10
         addScript("println('hello world');");
10
         addScript("println('hello world');");
11
         executeEngine();
11
         executeEngine();
12
-        
12
+    
13
+        logger.assertNoErrors();
14
+        logger.assertNoWarnings();
13
         logger.assertPrintOutputSize(1);
15
         logger.assertPrintOutputSize(1);
14
         logger.assertPrintOutput(0, "hello world");
16
         logger.assertPrintOutput(0, "hello world");
15
     }
17
     }

+ 5
- 1
ScriptingExample/src/test/java/org/openzen/zenscript/scriptingexample/tests/actual_test/arithmethic_operators/AdditionTest.java View File

13
         addScript(String.format("println(%d + %d);", i, j));
13
         addScript(String.format("println(%d + %d);", i, j));
14
         executeEngine();
14
         executeEngine();
15
         
15
         
16
+        logger.assertNoErrors();
17
+        logger.assertNoWarnings();
16
         logger.assertPrintOutputSize(1);
18
         logger.assertPrintOutputSize(1);
17
         logger.assertPrintOutput(0, String.valueOf(i + j));
19
         logger.assertPrintOutput(0, String.valueOf(i + j));
18
     }
20
     }
21
     public void testChainedAdditions() {
23
     public void testChainedAdditions() {
22
         addScript("println(1+2+3+4+5+6+7+8+9+10);");
24
         addScript("println(1+2+3+4+5+6+7+8+9+10);");
23
         executeEngine();
25
         executeEngine();
24
-        
26
+    
27
+        logger.assertNoErrors();
28
+        logger.assertNoWarnings();
25
         logger.assertPrintOutputSize(1);
29
         logger.assertPrintOutputSize(1);
26
         logger.assertPrintOutput(0, String.valueOf(55));
30
         logger.assertPrintOutput(0, String.valueOf(55));
27
     }
31
     }

+ 3
- 1
ScriptingExample/src/test/java/org/openzen/zenscript/scriptingexample/tests/actual_test/control_structures/LoopTest.java View File

9
     public void validateOutput() {
9
     public void validateOutput() {
10
         addScript("for i in 0 .. 100 println(i);");
10
         addScript("for i in 0 .. 100 println(i);");
11
         executeEngine();
11
         executeEngine();
12
-        
12
+    
13
+        logger.assertNoErrors();
14
+        logger.assertNoWarnings();
13
         logger.assertPrintOutputSize(100);
15
         logger.assertPrintOutputSize(100);
14
         for(int i = 0; i < 100; i++) {
16
         for(int i = 0; i < 100; i++) {
15
             logger.assertPrintOutput(i, String.valueOf(i));
17
             logger.assertPrintOutput(i, String.valueOf(i));

+ 4
- 0
ScriptingExample/src/test/java/org/openzen/zenscript/scriptingexample/tests/actual_test/packages/SamePackage.java View File

11
         addScript("println(doSomething());", "b.zs");
11
         addScript("println(doSomething());", "b.zs");
12
         
12
         
13
         executeEngine();
13
         executeEngine();
14
+        logger.assertNoErrors();
15
+        logger.assertNoWarnings();
14
         logger.assertPrintOutputSize(1);
16
         logger.assertPrintOutputSize(1);
15
         logger.assertPrintOutput(0, "Hello World");
17
         logger.assertPrintOutput(0, "Hello World");
16
     }
18
     }
21
         addScript("println(doSomething());", "some/test/package/b.zs");
23
         addScript("println(doSomething());", "some/test/package/b.zs");
22
     
24
     
23
         executeEngine();
25
         executeEngine();
26
+        logger.assertNoErrors();
27
+        logger.assertNoWarnings();
24
         logger.assertPrintOutputSize(1);
28
         logger.assertPrintOutputSize(1);
25
         logger.assertPrintOutput(0, "Hello World");
29
         logger.assertPrintOutput(0, "Hello World");
26
     }
30
     }

Loading…
Cancel
Save