From 887c093afdb49b9bd2a2a4930c0a6a331662399d Mon Sep 17 00:00:00 2001 From: Stiver Date: Wed, 13 Aug 2014 22:17:21 +0200 Subject: Unit tests updated --- test/unit/classes/TestClassLoop.java | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'test/unit/classes/TestClassLoop.java') diff --git a/test/unit/classes/TestClassLoop.java b/test/unit/classes/TestClassLoop.java index 4275153..5288cf6 100644 --- a/test/unit/classes/TestClassLoop.java +++ b/test/unit/classes/TestClassLoop.java @@ -1,10 +1,19 @@ -package test.input; +package unit.classes; -public class TestLoop { +public class TestClassLoop { - public static void main(String[] args) { + public static void testSimpleInfinite() { - boolean a = true; + while(true) { + System.out.println(); + } + + } + + public static void testFinally() { + + boolean a = (Math.random() > 0); + while(true) { try { if(!a) { @@ -16,5 +25,24 @@ public class TestLoop { } } + + public static void testFinallyContinue() { + + boolean a = (Math.random() > 0); + + for(;;) { + try { + System.out.println("1"); + } finally { + if(a) { + System.out.println("3"); + continue; + } + } + + System.out.println("4"); + } + + } } -- cgit v1.2.3