From: Graham B. <gb...@us...> - 2002-08-19 23:51:40
|
Update of /cvsroot/perl-ldap/asn/t In directory usw-pr-cvs1:/tmp/cvs-serv7018/t Modified Files: 10choice.t Log Message: Fix for nested CHOICEs and tagged CHOICEs in SEQUENCES Index: 10choice.t =================================================================== RCS file: /cvsroot/perl-ldap/asn/t/10choice.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- 10choice.t 25 Mar 2002 09:06:18 -0000 1.1 +++ 10choice.t 19 Aug 2002 23:51:38 -0000 1.2 @@ -42,3 +42,12 @@ ntest 5, 13, $seq->{list}->[0]->{prime}; ntest 6, 28, $seq->{list}->[1]->{product}->{perfect}; ntest 7, 42, $seq->{list}->[2]->{product}->{plain}; + + +btest 8, $asn->prepare( 'Foo ::= [1] EXPLICIT CHOICE { a NULL }' ) or warn $asn->error; +$nl = $asn->find('Foo'); +$buf = $nl->encode( a => 1 ); +$result = pack 'C*', map hex, qw(A1 02 05 00); +stest 9, $result, $buf; +$seq = $nl->decode( $result ) or warn $asn->error; +btest 10, $seq->{a}; |