In org.eclipse.jgit.pgm.ConfigTest expect core.filemode=false on Windows

Change-Id: I8f8ae7a8bc0793643184bc0e7afa9f4e2c5ff1a1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Tomasz Zarna 2012-06-16 00:26:31 +02:00 committed by Matthias Sohn
parent 80113c7bb6
commit 70a9d3e882
1 changed files with 10 additions and 8 deletions

View File

@ -42,11 +42,11 @@
*/ */
package org.eclipse.jgit.pgm; package org.eclipse.jgit.pgm;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertTrue;
import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.CLIRepositoryTestCase; import org.eclipse.jgit.lib.CLIRepositoryTestCase;
import org.eclipse.jgit.util.SystemReader;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -60,12 +60,14 @@ public void setUp() throws Exception {
@Test @Test
public void testListConfig() throws Exception { public void testListConfig() throws Exception {
boolean isWindows = SystemReader.getInstance().getProperty("os.name")
.startsWith("Windows");
String[] output = execute("git config --list"); String[] output = execute("git config --list");
// value depends on platform assertArrayEquals("expected default configuration", //
assertTrue(output[0].startsWith("core.filemode=")); new String[] { "core.filemode=" + !isWindows, //
assertTrue(output[0].endsWith("true") || output[0].endsWith("false")); "core.logallrefupdates=true", //
assertEquals("core.logallrefupdates=true", output[1]); "core.repositoryformatversion=0", //
assertEquals("core.repositoryformatversion=0", output[2]); "" /* ends with LF (last line empty) */}, output);
assertEquals("", output[3]); /* ends with LF (last line empty) */
} }
} }