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

Version Path
trackler-2.2.1.18 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.17 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.16 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.15 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.14 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.13 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.12 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.11 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.10 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.9 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.8 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.7 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.6 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.5 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.4 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.3 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.2 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.1 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.0 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.0.6 tracks/ecmascript/exercises/trinary/trinary.spec.js