]>
Commit | Line | Data |
---|---|---|
9575ded8 NL |
1 | /* eslint-disable no-console */ |
2 | const expect = chai.expect; | |
3 | ||
4 | import { toUnsigned32bit, toSigned32bit } from '../core/util/int.js'; | |
5 | ||
6 | describe('Integer casting', function () { | |
7 | it('should cast unsigned to signed', function () { | |
8 | let expected = 4294967286; | |
9 | expect(toUnsigned32bit(-10)).to.equal(expected); | |
10 | }); | |
11 | ||
12 | it('should cast signed to unsigned', function () { | |
13 | let expected = -10; | |
14 | expect(toSigned32bit(4294967286)).to.equal(expected); | |
15 | }); | |
16 | }); |