Skip to content

Commit

Permalink
Simplified langauge nested length-encoding.
Browse files Browse the repository at this point in the history
See #81.
  • Loading branch information
flatheadmill committed Feb 21, 2020
1 parent a99efc7 commit b8b4fee
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/language/length-encoded-variable.t.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
require('proof')(1, okay => {
const simplified = require('../../simplified')
okay(simplified({ packet: { value: [ 16, [{ first: [ 16, [ 16 ] ] }] ] } }), [{
name: 'packet',
fixed: false,
bits: 16,
type: 'structure',
lengthEncoded: true,
fields: [{
name: 'value',
type: 'lengthEncoding',
fixed: true,
bits: 16,
endianness: 'big',
compliment: false
}, {
name: 'value',
type: 'lengthEncoded',
fixed: false,
bits: 0,
element: {
type: 'structure',
bits: 16,
fixed: false,
fields: [{
name: 'first',
type: 'lengthEncoding',
fixed: true,
bits: 16,
endianness: 'big',
compliment: false
}, {
name: 'first',
type: 'lengthEncoded',
fixed: false,
bits: 0,
element: {
type: 'integer',
fixed: true,
bits: 16,
endianness: 'big',
compliment: false
}
}]
}
}]
}], 'length-encoded-variable')
})

0 comments on commit b8b4fee

Please sign in to comment.