Sha256: 182bfc7293712abf91c376554be8452928b83c6a8ab830b66be6505c64353a58

Contents?: true

Size: 1.05 KB

Versions: 72

Compression:

Stored size: 1.05 KB

Contents

component extends="testbox.system.BaseSpec" {

	function beforeAll(){
	  SUT = createObject( 'SaddlePoints' );
	}

	function run(){
	
		describe( "My SaddlePoints class", function(){			

			it( 'Can identify single saddle point', function(){
				expect( SUT.saddlePoints( input=[[9, 8, 7], [5, 3, 2], [6, 6, 7]] ) ).toBe( [{"row":1,"column":0}] );
			});

			it( 'Can identify that empty matrix has no saddle points', function(){
				expect( SUT.saddlePoints( input=[[]] ) ).toBe( [] );
			});

			it( 'Can identify lack of saddle points when there are none', function(){
				expect( SUT.saddlePoints( input=[[1, 2, 3], [3, 1, 2], [2, 3, 1]] ) ).toBe( [] );
			});

			it( 'Can identify multiple saddle points', function(){
				expect( SUT.saddlePoints( input=[[4, 5, 4], [3, 5, 5], [1, 5, 4]] ) ).toBe( [{"row":0,"column":1},{"row":1,"column":1},{"row":2,"column":1}] );
			});

			it( 'Can identify saddle point in bottom right corner', function(){
				expect( SUT.saddlePoints( input=[[8, 7, 9], [6, 7, 6], [3, 2, 5]] ) ).toBe( [{"row":2,"column":2}] );
			});

		});
		
	}
 
}

Version data entries

72 entries across 71 versions & 1 rubygems

Version Path
trackler-2.2.1.84 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.83 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.82 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.81 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.80 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.79 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.78 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.77 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.76 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.75 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.74 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.73 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.72 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.71 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.70 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.69 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.68 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.67 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.66 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.65 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc