diff options
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java index 1b7276bf77..315c495606 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java @@ -44,6 +44,7 @@ package org.eclipse.jgit.lib; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.util.Date; import java.util.TimeZone; @@ -83,4 +84,15 @@ public class T0001_PersonIdentTest { public void nullForEmailShouldThrowIllegalArgumentException() { new PersonIdent("A U Thor", null); } + + @Test + public void testToExternalStringTrimsNameAndEmail() throws Exception { + PersonIdent personIdent = new PersonIdent(" A U Thor ", + " author@example.com "); + + String externalString = personIdent.toExternalString(); + + assertTrue(externalString.startsWith("A U Thor <author@example.com>")); + } + } |