ExpressionTokenizer { protected int indexOfUnquoted(String str, String sub) { return indexOfUnquoted(str, sub, 0); } ExpressionTokenizer(String arg); List<String> getCommandStrings();  }
@Test public void testContainsUnquoted1() { String str = "ls -ltr >> file1.txt"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(8, t.indexOfUnquoted(str, ">>")); }
@Test public void testContainsUnquoted2() { String str = "ls -ltr \">>\" file1.txt"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(-1, t.indexOfUnquoted(str, ">>")); }
@Test public void testContainsUnquoted3() { String str = "ls \"-ltr >>\" file1.txt"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(-1, t.indexOfUnquoted(str, ">>")); }
@Test public void testContainsUnquoted4() { String str = "ls \"-ltr >>\" > file1.txt"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(13, t.indexOfUnquoted(str, ">")); }
@Test public void testContainsUnquoted5() { String str = "ls \"-ltr >>\" > > file1.txt"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(13, t.indexOfUnquoted(str, ">")); assertEquals(15, t.indexOfUnquoted(str, ">", 14)); }
@Test public void testContainsUnquoted6() { String str = "ls \"-ltr >\">\" > >> file1.txt"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(11, t.indexOfUnquoted(str, ">")); assertEquals(14, t.indexOfUnquoted(str, ">", 12)); assertEquals(16, t.indexOfUnquoted(str, ">", 15)); assertEquals(17, t.indexOfUnquoted(str, ">", 17)); }