~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/encoding/asn1/asn1_test.go

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2012-05-02 15:44:59 UTC
  • mfrom: (14.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120502154459-wcmy8ao1325ml619
Tags: 2:1.0.1-1
* Imported Upstream version 1.0.1
* Apply godoc patch to display package list correctly (Closes: #669354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
        {[]byte{0x00, 0x83, 0x01, 0x00}, false, tagAndLength{}},
284
284
        {[]byte{0x1f, 0x85}, false, tagAndLength{}},
285
285
        {[]byte{0x30, 0x80}, false, tagAndLength{}},
 
286
        // Superfluous zeros in the length should be an error.
 
287
        {[]byte{0xa0, 0x82, 0x00, 0x01}, false, tagAndLength{}},
 
288
        // Lengths up to the maximum size of an int should work.
 
289
        {[]byte{0xa0, 0x84, 0x7f, 0xff, 0xff, 0xff}, true, tagAndLength{2, 0, 0x7fffffff, true}},
 
290
        // Lengths that would overflow an int should be rejected.
 
291
        {[]byte{0xa0, 0x84, 0x80, 0x00, 0x00, 0x00}, false, tagAndLength{}},
286
292
}
287
293
 
288
294
func TestParseTagAndLength(t *testing.T) {