Sha256: 95a17441afc34722b93f855f161867ef22e258c78822eac5e9ce3b35dfeaf6a2

Contents?: true

Size: 1.06 KB

Versions: 74

Compression:

Stored size: 1.06 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( matrix=[[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( matrix=[[]] ) ).toBe( [] );
			});

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

			it( 'Can identify multiple saddle points', function(){
				expect( SUT.saddlePoints( matrix=[[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( matrix=[[8, 7, 9], [6, 7, 6], [3, 2, 5]] ) ).toBe( [{"row":2,"column":2}] );
			});

		});
		
	}
 
}

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.179 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.178 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.177 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.176 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.175 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.174 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.173 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.172 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.171 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.170 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.169 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.167 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.166 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.165 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.164 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.163 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.162 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.161 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.160 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc