Sha256: 1ce44f426ba89dba26e7c39731204b6a03673484a4f96d353940c62963e426e2

Contents?: true

Size: 1.11 KB

Versions: 141

Compression:

Stored size: 1.11 KB

Contents

var RLE = require('./run-length-encoding');

describe('Run-length encoding', function () {
  it('encode empty string', function () {
    expect(RLE.encode('')).toEqual('');
  });

  xit('encode single characters only', function () {
    expect(RLE.encode('XYZ')).toEqual('XYZ');
  });

  xit('decode empty string', function () {
    expect(RLE.decode('')).toEqual('');
  });

  xit('decode single characters only', function () {
    expect(RLE.decode('XYZ')).toEqual('XYZ');
  });

  xit('encode simple', function () {
    expect(RLE.encode('AABBBCCCC')).toEqual('2A3B4C');
  });

  xit('decode simple', function () {
    expect(RLE.decode('2A3B4C')).toEqual('AABBBCCCC');
  });

  xit('encode with single values', function () {
    expect(RLE.encode('WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB')).toEqual('12WB12W3B24WB');
  });

  xit('decode with single values', function () {
    expect(RLE.decode('12WB12W3B24WB')).toEqual('WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB');
  });

  xit('decode(encode(...))combination', function () {
    expect(RLE.decode(RLE.encode('zzz ZZ  zZ'))).toEqual('zzz ZZ  zZ');
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.58 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.57 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.56 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.55 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.54 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.53 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.52 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.51 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.50 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.49 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.48 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.47 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.46 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.45 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.44 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.43 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.42 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.41 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.40 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js
trackler-2.2.1.39 tracks/javascript/exercises/run-length-encoding/run-length-encoding.spec.js