package lrs.visitor.test; import junit.framework.TestCase; import lrs.*; import lrs.visitor.*; /** * A JUnit test case class. * Every method starting with the word "test" will be called when running * the test with JUnit. */ public class TestUnzip extends TestCase { private static IAlgo unzip = Unzip.Singleton; /** */ public void testEmptyCase() { LRStruct l1 = new LRStruct(); System.out.println("Before unzipping l1 = " + l1); System.out.println ("Unzipping l1 returns: " + l1.execute(unzip)); System.out.println("After unzipping l1 = " + l1); System.out.println(); } /** */ public void testNonEmptyCase() { LRStruct l1 = new LRStruct(); l1.insertFront(263); System.out.println("Before unzipping l1 = " + l1); System.out.println ("Unzipping l1 returns: " + l1.execute(unzip)); System.out.println("After unzipping l1 = " + l1); System.out.println(); l1.insertFront(15); System.out.println("Before unzipping l1 = " + l1); System.out.println ("Unzipping l1 returns: " + l1.execute(unzip)); System.out.println("After unzipping l1 = " + l1); System.out.println(); l1.insertFront(-9); l1.insertFront(-72); System.out.println("Before unzipping l1 = " + l1); System.out.println ("Unzipping l1 returns: " + l1.execute(unzip)); System.out.println("After unzipping l1 = " + l1); System.out.println(); l1.insertFront(0); l1.insertFront(55); System.out.println("Before unzipping l1 = " + l1); System.out.println ("Unzipping l1 returns: " + l1.execute(unzip)); System.out.println("After unzipping l1 = " + l1); System.out.println(); } }