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 TestRemDupFwd extends TestCase { private static IAlgo remDup = RemDupFwd.Singleton; /** */ public void testEmptyCase() { LRStruct L = new LRStruct(); assertEquals("() remDup: ", "()", L.execute(remDup).toString()); } /** */ public void testNonEmptyCase() { LRStruct L = new LRStruct(); L.insertFront(5); assertEquals("(5) remDups: ", "(5)", L.execute(remDup).toString()); L.insertFront(5); assertEquals("(5 5) remDups: ", "(5)", L.execute(remDup).toString()); L.insertFront(10); assertEquals("(10 5) remDups: ", "(10 5)", L.execute(remDup).toString()); L.insertFront(3); L.insertFront(5); L.insertFront(10); L.insertFront(5); L.insertFront(3); L.insertFront(5); L.insertFront(99); assertEquals("(99 5 3 5 10 5 3 10 5) remDups: ", "(99 5 3 10)", L.execute(remDup).toString()); } }