aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-03-30 11:03:33 +0100
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2013-06-14 19:52:29 -0400
commitb0ffacf1226e3c0b0d8fd6ed0beb7311e508dc14 (patch)
tree858ed9000b96402b568c8aac7df93dc0ff927b6e /org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java
parentc693a232b042fab7748dce956f642a77865d3482 (diff)
downloadjgit-b0ffacf1226e3c0b0d8fd6ed0beb7311e508dc14.tar.gz
jgit-b0ffacf1226e3c0b0d8fd6ed0beb7311e508dc14.zip
Recognize CRLF when parsing the short message of a commit or tag
Bug: 400707 Change-Id: I9b09bb88528af465018fc0278f5441f7e6b75986
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java
index d7b92ade9d..86fed22afe 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java
@@ -91,4 +91,16 @@ public class StringUtilsTest {
assertTrue(StringUtils.equalsIgnoreCase("A", "a"));
assertTrue(StringUtils.equalsIgnoreCase("a", "A"));
}
+
+ @Test
+ public void testReplaceLineBreaks() {
+ assertEquals("a b c ",
+ StringUtils.replaceLineBreaksWithSpace("a b\nc\r"));
+ assertEquals("a b c ",
+ StringUtils.replaceLineBreaksWithSpace("a b\nc\n"));
+ assertEquals("a b c ",
+ StringUtils.replaceLineBreaksWithSpace("a b\nc\r\n"));
+ assertEquals("a b c d",
+ StringUtils.replaceLineBreaksWithSpace("a\r\nb\nc d"));
+ }
}