Update of /cvsroot/perl-ldap/ldap/t
In directory usw-pr-cvs1:/tmp/cvs-serv19453/t
Modified Files:
01canon_dn.t
Log Message:
move some logic from canonical_dn into explode_dn and add some more
tests for DNs
Index: 01canon_dn.t
===================================================================
RCS file: /cvsroot/perl-ldap/ldap/t/01canon_dn.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 01canon_dn.t 2001/04/11 09:20:03 1.6
+++ 01canon_dn.t 2002/01/31 15:25:52 1.7
@@ -45,11 +45,106 @@
same cn=Clif Harden+IDNumber="a0125589 ",ou=tiPerson,ou=person,o=ti,c=us
- ref CN=\20\20Graham Barr\20\20,OU=person,O=vc,C=us
- same Cn=" Graham Barr ",OU=person,O=vc,C=us
- same cn=" Graham \20Barr\20 ",OU=person,O=vc,C=us
+ ref CN=\20\20Graham Barr\20\20,OU=person,O=vc,C=us
+ same Cn=" Graham Barr ",OU=person,O=vc,C=us
+ same cn=" Graham \20Barr\20 ",OU=person,O=vc,C=us
+
+ # empty
+ ref
+
+ ref UID=jsmith,DC=example,DC=net
+ same UID=jsmith,DC=example,DC=net
+
+ ref CN=J. Smith+OU=Sales,DC=example,DC=net
+ same OU=Sales+CN=J. Smith,DC=example,DC=net
+
+ ref CN=John Smith\, III,DC=example,DC=net
+ same CN=John Smith\, III,DC=example,DC=net
+ same CN=John Smith\2C III,DC=example,DC=net
+
+ ref CN=Before\\0dAfter,DC=example,DC=net
+ same CN=Before\\0dAfter,DC=example,DC=net
+
+ ref CN=\#John Smith\20,DC=example,DC=net
+ same CN=\23John Smith\20,DC=example,DC=net
+ same CN=\#John Smith\ ,DC=example,DC=net
+ ref 1.3.6.1.4.1.1466.0=#04024869,DC=example,DC=com
+ same 1.3.6.1.4.1.1466.0=#04024869,DC=example,DC=com
+
+ ref CN=Lu\\C4\\8Di\\C4\\87
+ same CN=Lu\\C4\\8Di\\C4\\87
+
+ # empty value
+ ref 1.1.1=
+
+ # option
+ bad uid;x-option=jsmith
+
+ # invalid attribute type name
+ bad at_tr=jsmith
+
+ # invalid attribute type name
+ bad -attr=jsmith
+
+ # invalid attribute type name
+ #bad OID.1.1=jsmith
+
+ # invalid numeric OID
+ bad 1..1=jsmith
+
+ # invalid numeric OID
+ bad 1.1.=jsmith
+ # invalid numeric OID
+ #bad 01.1=jsmith
+
+ # invalid numeric OID
+ bad 1.ff=jsmith
+
+ # invalid HEX form
+ bad 1.1.1=#GG
+
+ # invalid HEX form
+ bad 1.1.1=#000
+
+ # invalid HEX form
+ bad 1.1.1=#F
+
+ # invalid HEX form
+ bad 1.1.1=#
+
+ # spaces
+ #bad UID=jsmith, DC=example, DC=net
+
+ # extra comma
+ bad UID=jsmith,,DC=example,DC=net
+
+ # semi-colons
+ #bad UID=jsmith;DC=example;DC=net
+
+ # quotes
+ #bad CN="John Smith",DC=example,DC=net
+
+ # brackets
+ bad <UID=jsmith,DC=example,DC=net>
+
+ # unescaped ,
+ bad UID=john,smith
+
+ # unescaped +
+ bad UID=john+smith
+
+ # invalid escape of ? or unescaped \
+ bad UID=john\?smith
+
+ # invalid hex escape
+ bad UID=john\Fsmith
+
+ # invalid hex escape
+ bad UID=john\GGsmith
+
+
EOS
print "1..", scalar(@tests)>>1, "\n";
@@ -68,7 +163,7 @@
}
elsif ($op eq 'bad') {
if ($failed = defined $canon) {
- print "'$dn' should not have parsed\n";
+ print "'$dn' should not have parsed\n '$canon'\n";
}
}
elsif ( $op eq 'same' ) {
|