Sha256: c2c9f567ab25c9501f2e13197e1726611342ef268de872e45dd7a845ecb47e76
Contents?: true
Size: 1.05 KB
Versions: 185
Compression:
Stored size: 1.05 KB
Contents
import Trinary from './trinary'; describe('Trinary', () => { test('1 is decimal 1', () => { expect(1).toEqual(new Trinary('1').toDecimal()); }); xtest('2 is decimal 2', () => { expect(2).toEqual(new Trinary('2').toDecimal()); }); xtest('10 is decimal 3', () => { expect(3).toEqual(new Trinary('10').toDecimal()); }); xtest('11 is decimal 4', () => { expect(4).toEqual(new Trinary('11').toDecimal()); }); xtest('100 is decimal 9', () => { expect(9).toEqual(new Trinary('100').toDecimal()); }); xtest('112 is decimal 14', () => { expect(14).toEqual(new Trinary('112').toDecimal()); }); xtest('222 is 26', () => { expect(26).toEqual(new Trinary('222').toDecimal()); }); xtest('1122000120 is 32091', () => { expect(32091).toEqual(new Trinary('1122000120').toDecimal()); }); xtest('invalid trinary is decimal 0', () => { expect(0).toEqual(new Trinary('carrot').toDecimal()); }); xtest('digits from 3 to 9 are invalid', () => { expect(0).toEqual(new Trinary('123').toDecimal()); }); });
Version data entries
185 entries across 185 versions & 1 rubygems