Skip to content

Commit

Permalink
[tests] add more tests to protobuf-util
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Feb 2, 2024
1 parent 1a4215e commit 4834c67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/protobuf-util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,13 @@ describe('protobuf-util', () => {
it('returns several values when several bits are set', () => {
expect(extractBits(10, FirmwareModuleValidityFlag)).to.eql(['INTEGRITY_CHECK_FAILED', 'RANGE_CHECK_FAILED']);
});

it('parses known bits and ignores unknown bits', () => {
expect(extractBits(3, FirmwareModuleValidityFlag)).to.eql(['INTEGRITY_CHECK_FAILED']);
});

it('ignores bits that are unknown', () => {
expect(extractBits(1, FirmwareModuleValidityFlag)).to.eql([]);
});
});
});

0 comments on commit 4834c67

Please sign in to comment.