runtime = Ruby.newInstance();
}
}
public void testOptParse() throws Exception {
Command cmd = RubyNKF.parseOption("-j");
assertEquals("[[opt: j longOpt: jis hasArg: false pattern: null value: null]]", cmd.toString());
cmd = RubyNKF.parseOption("--hiragana");
assertEquals("[[opt: h1 longOpt: hiragana hasArg: false pattern: null value: null]]", cmd.toString());
cmd = RubyNKF.parseOption("-j --hiragana");
assertEquals("[[opt: j longOpt: jis hasArg: false pattern: null value: null], [opt: h1 longOpt: hiragana hasArg: false pattern: null value: null]]", cmd.toString());
cmd = RubyNKF.parseOption("-Z");
assertEquals("[[opt: Z longOpt: null hasArg: true pattern: [0-3] value: null]]", cmd.toString());
assertTrue(cmd.hasOption("Z"));
cmd = RubyNKF.parseOption("-Z0");
assertEquals("[[opt: Z longOpt: null hasArg: true pattern: [0-3] value: 0]]", cmd.toString());
cmd = RubyNKF.parseOption("-Z1");
assertEquals("[[opt: Z longOpt: null hasArg: true pattern: [0-3] value: 1]]", cmd.toString());
cmd = RubyNKF.parseOption("--unix");
assertEquals("[[opt: null longOpt: unix hasArg: false pattern: null value: null]]", cmd.toString());
assertTrue(cmd.hasOption("unix"));
cmd = RubyNKF.parseOption("-m");
assertEquals("[[opt: m longOpt: null hasArg: true pattern: [BQN0] value: null]]", cmd.toString());
}