mirror of
https://git.proxmox.com/git/mirror_novnc
synced 2025-04-28 16:31:02 +00:00

karma-sinon-chai is not compatible with Chai 5+, and Karma is no longer being updated. Load sinon and chai manually instead, until we can have a long term plan in place.
14 lines
426 B
JavaScript
14 lines
426 B
JavaScript
import { toUnsigned32bit, toSigned32bit } from '../core/util/int.js';
|
|
|
|
describe('Integer casting', function () {
|
|
it('should cast unsigned to signed', function () {
|
|
let expected = 4294967286;
|
|
expect(toUnsigned32bit(-10)).to.equal(expected);
|
|
});
|
|
|
|
it('should cast signed to unsigned', function () {
|
|
let expected = -10;
|
|
expect(toSigned32bit(4294967286)).to.equal(expected);
|
|
});
|
|
});
|