diff options
author | Dave Borowitz <dborowitz@google.com> | 2016-04-29 10:47:17 -0400 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2016-04-29 11:27:06 -0400 |
commit | 773f9661d0634fb3ad69466c0f0ec4d65cb2122d (patch) | |
tree | bdbbaa1402cdbaee50b88cd124aea8894565726f /org.eclipse.jgit.test/tst/org/eclipse/jgit/lib | |
parent | adff322a698b2f248180c0a2c81dbeaf50015420 (diff) | |
download | jgit-773f9661d0634fb3ad69466c0f0ec4d65cb2122d.tar.gz jgit-773f9661d0634fb3ad69466c0f0ec4d65cb2122d.zip |
PersonIdent: Document that name and email aren't trimmed
This might be somewhat surprising behavior to users who might
naturally assume the following invariant:
ident.equals(parseIdent(ident.toExternalString()))
This invariant does not hold since whitespace is only trimmed during
serialization. We don't want to mess with the strings during
initialization, as this is called during the highly-optimized commit
parsing codepath.
Change-Id: I081a603f0ac0e33167462244779b0ff3ad51e80c
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/lib')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java | 4 |
1 files changed, 3 insertions, 1 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 1515a07ac4..48d2c480a9 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 @@ -92,8 +92,10 @@ public class T0001_PersonIdentTest { PersonIdent personIdent = new PersonIdent(" A U Thor ", " author@example.com "); - String externalString = personIdent.toExternalString(); + assertEquals(" A U Thor ", personIdent.getName()); + assertEquals(" author@example.com ", personIdent.getEmailAddress()); + String externalString = personIdent.toExternalString(); assertTrue(externalString.startsWith("A U Thor <author@example.com>")); } |