Sha256: 7e4778f3eafbb41e09ecc103e9bc46c02b879bbca962102beba8d692e47b1103

Contents?: true

Size: 1.26 KB

Versions: 255

Compression:

Stored size: 1.26 KB

Contents

var Matrix = require('./saddle-points');

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

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

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

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

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

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

  xit('another saddle point', function() {
    var 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', function() {
    var 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

255 entries across 255 versions & 1 rubygems

Version Path
trackler-2.0.0.4 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.0.0.3 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.0.0.2 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.0.0.1 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-2.0.0.0 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.4.1 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.4.0 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.3.0 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.2.1 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.2.0 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.1.2 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.1.1 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.1.0 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.0.1 tracks/javascript/exercises/saddle-points/saddle-points.spec.js
trackler-1.0.0 tracks/javascript/exercises/saddle-points/saddle-points.spec.js