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.180 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.179 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.178 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.177 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.176 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.175 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.174 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.173 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.172 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.171 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.170 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.169 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.167 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.166 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.165 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.164 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.163 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.162 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.161 tracks/ecmascript/exercises/trinary/trinary.spec.js
trackler-2.2.1.160 tracks/ecmascript/exercises/trinary/trinary.spec.js