@@ -11,55 +11,72 @@ func TestSuccessfulDNParsing(t *testing.T) {
1111 "cn=Jim\\ 2C \\ 22Hasse Hö\\ 22 Hansson!,dc=dummy,dc=com" : {[]* RelativeDN {
1212 {[]* AttributeTypeAndValue {{"cn" , "Jim, \" Hasse Hö\" Hansson!" }}},
1313 {[]* AttributeTypeAndValue {{"dc" , "dummy" }}},
14- {[]* AttributeTypeAndValue {{"dc" , "com" }}}}},
14+ {[]* AttributeTypeAndValue {{"dc" , "com" }}},
15+ }},
1516 "UID=jsmith,DC=example,DC=net" : {[]* RelativeDN {
1617 {[]* AttributeTypeAndValue {{"UID" , "jsmith" }}},
1718 {[]* AttributeTypeAndValue {{"DC" , "example" }}},
18- {[]* AttributeTypeAndValue {{"DC" , "net" }}}}},
19+ {[]* AttributeTypeAndValue {{"DC" , "net" }}},
20+ }},
1921 "OU=Sales+CN=J. Smith,DC=example,DC=net" : {[]* RelativeDN {
2022 {[]* AttributeTypeAndValue {
2123 {"OU" , "Sales" },
22- {"CN" , "J. Smith" }}},
24+ {"CN" , "J. Smith" },
25+ }},
2326 {[]* AttributeTypeAndValue {{"DC" , "example" }}},
24- {[]* AttributeTypeAndValue {{"DC" , "net" }}}}},
27+ {[]* AttributeTypeAndValue {{"DC" , "net" }}},
28+ }},
2529 "1.3.6.1.4.1.1466.0=#04024869" : {[]* RelativeDN {
26- {[]* AttributeTypeAndValue {{"1.3.6.1.4.1.1466.0" , "Hi" }}}}},
30+ {[]* AttributeTypeAndValue {{"1.3.6.1.4.1.1466.0" , "Hi" }}},
31+ }},
2732 "1.3.6.1.4.1.1466.0=#04024869,DC=net" : {[]* RelativeDN {
2833 {[]* AttributeTypeAndValue {{"1.3.6.1.4.1.1466.0" , "Hi" }}},
29- {[]* AttributeTypeAndValue {{"DC" , "net" }}}}},
34+ {[]* AttributeTypeAndValue {{"DC" , "net" }}},
35+ }},
3036 "CN=Lu\\ C4\\ 8Di\\ C4\\ 87" : {[]* RelativeDN {
31- {[]* AttributeTypeAndValue {{"CN" , "Lučić" }}}}},
37+ {[]* AttributeTypeAndValue {{"CN" , "Lučić" }}},
38+ }},
3239 " CN = Lu\\ C4\\ 8Di\\ C4\\ 87 " : {[]* RelativeDN {
33- {[]* AttributeTypeAndValue {{"CN" , "Lučić" }}}}},
40+ {[]* AttributeTypeAndValue {{"CN" , "Lučić" }}},
41+ }},
3442 ` A = 1 , B = 2 ` : {[]* RelativeDN {
3543 {[]* AttributeTypeAndValue {{"A" , "1" }}},
36- {[]* AttributeTypeAndValue {{"B" , "2" }}}}},
44+ {[]* AttributeTypeAndValue {{"B" , "2" }}},
45+ }},
3746 ` A = 1 + B = 2 ` : {[]* RelativeDN {
3847 {[]* AttributeTypeAndValue {
3948 {"A" , "1" },
40- {"B" , "2" }}}}},
49+ {"B" , "2" },
50+ }},
51+ }},
4152 ` \ \ A\ \ = \ \ 1\ \ , \ \ B\ \ = \ \ 2\ \ ` : {[]* RelativeDN {
4253 {[]* AttributeTypeAndValue {{" A " , " 1 " }}},
43- {[]* AttributeTypeAndValue {{" B " , " 2 " }}}}},
54+ {[]* AttributeTypeAndValue {{" B " , " 2 " }}},
55+ }},
4456 ` \ \ A\ \ = \ \ 1\ \ + \ \ B\ \ = \ \ 2\ \ ` : {[]* RelativeDN {
4557 {[]* AttributeTypeAndValue {
4658 {" A " , " 1 " },
47- {" B " , " 2 " }}}}},
59+ {" B " , " 2 " },
60+ }},
61+ }},
4862
4963 `cn=john.doe;dc=example,dc=net` : {[]* RelativeDN {
5064 {[]* AttributeTypeAndValue {{"cn" , "john.doe" }}},
5165 {[]* AttributeTypeAndValue {{"dc" , "example" }}},
52- {[]* AttributeTypeAndValue {{"dc" , "net" }}}}},
66+ {[]* AttributeTypeAndValue {{"dc" , "net" }}},
67+ }},
5368
5469 // Escaped `;` should not be treated as RDN
5570 `cn=john.doe\;weird name,dc=example,dc=net` : {[]* RelativeDN {
5671 {[]* AttributeTypeAndValue {{"cn" , "john.doe;weird name" }}},
5772 {[]* AttributeTypeAndValue {{"dc" , "example" }}},
58- {[]* AttributeTypeAndValue {{"dc" , "net" }}}}},
73+ {[]* AttributeTypeAndValue {{"dc" , "net" }}},
74+ }},
5975 `cn=ZXhhbXBsZVRleHQ=,dc=dummy,dc=com` : {[]* RelativeDN {
6076 {[]* AttributeTypeAndValue {{"cn" , "ZXhhbXBsZVRleHQ=" }}},
6177 {[]* AttributeTypeAndValue {{"dc" , "dummy" }}},
62- {[]* AttributeTypeAndValue {{"dc" , "com" }}}}},
78+ {[]* AttributeTypeAndValue {{"dc" , "com" }}},
79+ }},
6380 }
6481
6582 for test , answer := range testcases {
0 commit comments