@Test public void testparseCommand_DoubleQuotesArmuredArgWithSpacesAndSimplequotesWithin() throws IOException { String line = "arg1 \"arg2 with spaces and 'simple quotes' within\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces and 'simple quotes' within", "arg3"); }
@Test public void testparseCommand_DoubleQuotesArmuredArgWithoutSpacesWithin() throws IOException { String line = "arg1 \"arg2\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "arg2", "arg3"); }
@Test public void testparseCommand_NoQuotes() throws IOException { String line = "arg1 arg2 arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "arg2", "arg3"); }
@Test public void testparseCommand_SimpleQuotesArmuredArgWithSpacesWithin() throws IOException { String line = "arg1 'arg2 with spaces within' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces within", "arg3"); }
@Test public void testparseCommand_SimpleQuotesArmuredArgWithoutSpaceWithin() throws IOException { String line = "arg1 'arg2' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "arg2", "arg3"); }
@Test public void testparseCommand_DoubleQuotesArmuredArgWithSpacesWithin() throws IOException { String line = "arg1 \"arg2 with spaces within\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces within", "arg3"); }
@Test public void testparseCommand_SimpleQuotesArmuredEmptyArg() throws IOException { String line = "arg1 '' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "", "arg3"); }
@Test public void testparseCommand_SimpleQuotesArmuredArgWithSpacesAndDoubleQuotesWithin() throws IOException { String line = "arg1 'arg2 with spaces and \"double quotes\" within' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces and \"double quotes\" within", "arg3"); }
@Test public void testparseCommand_DoubleQuotesArmuredEmptyArg() throws IOException { String line = "arg1 \"\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "", "arg3"); }
public static void verifyPumaResults(List<ReadResultQueryInfoTimeString> results) { assertThat(results) .as("results") .hasSize(2) .containsSequence( new ReadResultQueryInfoTimeString("now", ImmutableMap.of("apple", "apple", "banana", "banana")), new ReadResultQueryInfoTimeString("snack", ImmutableMap.of("cheetos", "cheetos", "doritos", "doritos")) ); } }