Skip to content

Commit

Permalink
Add a test case for a high tag with three octets
Browse files Browse the repository at this point in the history
  • Loading branch information
highmtworks committed Jan 16, 2021
1 parent 2688b0a commit 7c54cca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ test('decode: tagCode 50 (extended tag / aka high tag)', (t) => {
);
});

test('decode: tagCode 257 (extended tag / aka high tag with three octets)', (t) => {
t.deepEqual(
asn1Tree.decode(b(tag(CLS_CONTEXT_SPECIFIC, FORM_PRIMITIVE, 31), 130, 1, 3, f(3))),
{
cls: CLS_CONTEXT_SPECIFIC,
form: FORM_PRIMITIVE,
tagCode: 257,
value: f(3)
}
);
});

test('decode: primitive: element with length 0', (t) => {
t.deepEqual(
asn1Tree.decode(b(tag(CLS_UNIVERSAL, FORM_PRIMITIVE, TAG_NULL), 0)),
Expand Down

0 comments on commit 7c54cca

Please sign in to comment.