]> git.proxmox.com Git - mirror_novnc.git/blob - tests/test.int.js
Merge pull request #1414 from CendioOssman/gesture
[mirror_novnc.git] / tests / test.int.js
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 });