diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-03-30 11:03:33 +0100 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2013-06-14 19:52:29 -0400 |
commit | b0ffacf1226e3c0b0d8fd6ed0beb7311e508dc14 (patch) | |
tree | 858ed9000b96402b568c8aac7df93dc0ff927b6e /org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StringUtilsTest.java | |
parent | c693a232b042fab7748dce956f642a77865d3482 (diff) | |
download | jgit-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.java | 12 |
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")); + } } |