View Javadoc
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  
12  import static org.eclipse.jgit.pgm.CLIGitCommand.split;
13  import static org.junit.Assert.assertArrayEquals;
14  
15  import org.junit.Test;
16  
17  public class CLIGitCommandTest {
18  
19  	@Test
20  	public void testSplit() throws Exception {
21  		assertArrayEquals(new String[0], split(""));
22  		assertArrayEquals(new String[] { "a" }, split("a"));
23  		assertArrayEquals(new String[] { "a", "b" }, split("a b"));
24  		assertArrayEquals(new String[] { "a", "b c" }, split("a 'b c'"));
25  		assertArrayEquals(new String[] { "a", "b c" }, split("a \"b c\""));
26  		assertArrayEquals(new String[] { "a", "b\\c" }, split("a \"b\\c\""));
27  	}
28  }