Sha256: 515ed50997e76e8dcaedc8be6b822355dfdc3f1ca0ac1f1cef1bab6f8bb6c467

Contents?: true

Size: 1.23 KB

Versions: 208

Compression:

Stored size: 1.23 KB

Contents

import Matrix from './saddle-points';

describe('Matrix', () => {
  it('extracts a row', () => {
    const matrix = new Matrix('1 2\n10 20');
    expect(matrix.rows[0]).toEqual([1,2]);
  });

  xit('extracts other row', () => {
    const matrix = new Matrix('9 8 7\n19 18 17');
    expect(matrix.rows[1]).toEqual([19, 18, 17]);
  });

  xit('extracts a column', () => {
    const matrix = new Matrix('1 2 3\n4 5 6\n7 8 9\n 8 7 6');
    expect(matrix.columns[0]).toEqual([1, 4, 7, 8]);
  });

  xit('extracts another column', () => {
    const matrix = new Matrix('89 1903 3\n18 3 1\n9 4 800');
    expect(matrix.columns[1]).toEqual([1903, 3, 4]);
  });

  xit('no saddle point', () => {
    const matrix = new Matrix('2 1\n1 2');
    expect(matrix.saddlePoints).toEqual([]);
  });

  xit('a saddle point', () => {
    const matrix = new Matrix('1 2\n3 4');
    expect(matrix.saddlePoints).toEqual([[0,1]]);
  });

  xit('another saddle point', () => {
    const matrix = new Matrix('18 3 39 19 91\n38 10 8 77 320\n3 4 8 6 7');
    expect(matrix.saddlePoints).toEqual([[2,2]]);
  });

  xit('multiple saddle points', () => {
    const matrix = new Matrix('4 5 4\n3 5 5\n1 5 4');
    expect(matrix.saddlePoints).toEqual([[0, 1], [1, 1], [2, 1]]);
  });
});

Version data entries

208 entries across 208 versions & 1 rubygems

Version Path
trackler-2.1.0.53 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.52 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.51 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.50 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.49 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.48 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.47 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.46 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.45 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.44 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.43 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.42 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.41 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.40 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.39 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.38 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.37 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.36 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.34 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.1.0.33 tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js