You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CLIGitCommandTest.java 951B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 2011-2012, IBM Corporation and others. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.pgm;
  11. import static org.eclipse.jgit.pgm.CLIGitCommand.split;
  12. import static org.junit.Assert.assertArrayEquals;
  13. import org.junit.Test;
  14. public class CLIGitCommandTest {
  15. @Test
  16. public void testSplit() throws Exception {
  17. assertArrayEquals(new String[0], split(""));
  18. assertArrayEquals(new String[] { "a" }, split("a"));
  19. assertArrayEquals(new String[] { "a", "b" }, split("a b"));
  20. assertArrayEquals(new String[] { "a", "b c" }, split("a 'b c'"));
  21. assertArrayEquals(new String[] { "a", "b c" }, split("a \"b c\""));
  22. assertArrayEquals(new String[] { "a", "b\\c" }, split("a \"b\\c\""));
  23. }
  24. }