Skip to content

Instantly share code, notes, and snippets.

@okoye
Created May 28, 2010 09:33
Show Gist options
  • Save okoye/416966 to your computer and use it in GitHub Desktop.
Save okoye/416966 to your computer and use it in GitHub Desktop.
import static org.junit.Assert.*;
import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class TrieStructureTest
{
@Before
public void setUp() throws Exception
{
}
@After
public void tearDown() throws Exception
{
}
@Test
public void testPutWord()
{
TrieStructure x = new TrieStructure();
ArrayList<Integer> y;
assertTrue(x.putWord("chuka", 25));
assertTrue(x.putWord("cab", 30));
assertTrue(x.putWord("0chuka", 10));
assertTrue(x.putWord("xylophone", 17));
assertTrue(x.putWord("random", 1000));
assertTrue(x.getWordIndexes("chuka").contains(25));
assertTrue(x.getWordIndexes("xylophone").contains(17));
// assertFalse(x.putWord("", 21));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment