diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2022-01-30 22:47:38 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2022-01-30 22:47:38 +0100 |
commit | 8633ea4f07cbe10706a9edd1301f13aebe5be942 (patch) | |
tree | d59af62f970362b5ac4dc04dd2c5620831608a40 /org.eclipse.jgit.test | |
parent | 4bb87a957fb252b2b1512a0aec4344f6c91fa33d (diff) | |
download | jgit-8633ea4f07cbe10706a9edd1301f13aebe5be942.tar.gz jgit-8633ea4f07cbe10706a9edd1301f13aebe5be942.zip |
[test] DirCacheCheckoutTest: fix test expectation for eol=native
With eol=native, we expect LF on Unixes, and CR-LF on Windows. One test
didn't account for this and always expected LF, and thus failed on
Windows.
Bug: 550111
Change-Id: I69354ac691c464d1b6003812ddb4510c5ab5e77a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java index af8a58f6f0..813945adf8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java @@ -2,7 +2,7 @@ * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com> * Copyright (C) 2008-2011, Shawn O. Pearce <spearce@spearce.org> * Copyright (C) 2008-2011, Robin Rosenberg <robin.rosenberg@dewire.com> - * Copyright (C) 2010, 2020 Christian Halstrick <christian.halstrick@sap.com> and others + * Copyright (C) 2010, 2022 Christian Halstrick <christian.halstrick@sap.com> and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -313,8 +313,9 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { @Test public void testCheckoutWithLFAuto() throws Exception { - checkoutLineEndings("first line\nsecond line\n", - "first line\nsecond line\n", "f text=auto"); + String expected = String.format("first line%nsecond line%n"); + checkoutLineEndings("first line\nsecond line\n", expected, + "f text=auto"); } @Test @@ -325,9 +326,9 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { @Test public void testCheckoutWithLFAutoEolNative() throws Exception { + String expected = String.format("first line%nsecond line%n"); checkoutLineEndings( - "first line\nsecond line\n", "first line\nsecond line\n" - .replaceAll("\n", System.lineSeparator()), + "first line\nsecond line\n", expected, "f text=auto eol=native"); } |