public void testShortOptions(){
  ArgumentParser parser=new ArgumentParser(new String[]{"-a","-b","-cd","-efg","-h=j","-kl=m","-nop=qrs","-tu=vw xyz","=","-","-=","-1","-2=","-=3","-=4=5"},true);
  Iterator<String> iter=parser.iterator();
  assertEquals("-a",iter.next());
  assertEquals("-b",iter.next());
  assertEquals("-c",iter.next());
  assertEquals("-d",iter.next());
  assertEquals("-e",iter.next());
  assertEquals("-f",iter.next());
  assertEquals("-g",iter.next());
  assertEquals("-h",iter.next());
  assertEquals("j",iter.next());
  assertEquals("-k",iter.next());
  assertEquals("-l",iter.next());
  assertEquals("m",iter.next());
  assertEquals("-n",iter.next());
  assertEquals("-o",iter.next());
  assertEquals("-p",iter.next());
  assertEquals("qrs",iter.next());
  assertEquals("-t",iter.next());
  assertEquals("-u",iter.next());
  assertEquals("vw xyz",iter.next());
  assertEquals("=",iter.next());
  assertEquals("-",iter.next());
  assertEquals("-=",iter.next());
  assertEquals("-1",iter.next());
  assertEquals("-2",iter.next());
  assertEquals("",iter.next());
  assertEquals("-=3",iter.next());
  assertEquals("-=4=5",iter.next());
  assertIteratorAtEnd(iter);
}

public void testShortOptions ( ) { ArgumentParser parser = new ArgumentParser ( new String [ ] { "-a" , "-b" , "-cd" , "-efg" , "-h=j" , "-kl=m" , "-nop=qrs" , "-tu=vw xyz" , "=" , "-" , "-=" , "-1" , "-2=" , "-=3" , "-=4=5" } , true ) ; Iterator < String > iter = parser . iterator ( ) ; assertEquals ( "-a" , iter . next ( ) ) ; assertEquals ( "-b" , iter . next ( ) ) ; assertEquals ( "-c" , iter . next ( ) ) ; assertEquals ( "-d" , iter . next ( ) ) ; assertEquals ( "-e" , iter . next ( ) ) ; assertEquals ( "-f" , iter . next ( ) ) ; assertEquals ( "-g" , iter . next ( ) ) ; assertEquals ( "-h" , iter . next ( ) ) ; assertEquals ( "j" , iter . next ( ) ) ; assertEquals ( "-k" , iter . next ( ) ) ; assertEquals ( "-l" , iter . next ( ) ) ; assertEquals ( "m" , iter . next ( ) ) ; assertEquals ( "-n" , iter . next ( ) ) ; assertEquals ( "-o" , iter . next ( ) ) ; assertEquals ( "-p" , iter . next ( ) ) ; assertEquals ( "qrs" , iter . next ( ) ) ; assertEquals ( "-t" , iter . next ( ) ) ; assertEquals ( "-u" , iter . next ( ) ) ; assertEquals ( "vw xyz" , iter . next ( ) ) ; assertEquals ( "=" , iter . next ( ) ) ; assertEquals ( "-" , iter . next ( ) ) ; assertEquals ( "-=" , iter . next ( ) ) ; assertEquals ( "-1" , iter . next ( ) ) ; assertEquals ( "-2" , iter . next ( ) ) ; assertEquals ( "" , iter . next ( ) ) ; assertEquals ( "-=3" , iter . next ( ) ) ; assertEquals ( "-=4=5" , iter . next ( ) ) ; assertIteratorAtEnd ( iter ) ; }
test if short options ( beginning with ' - ' ) , which can be written in a collapsed form , are correctly recognized .
