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.104 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.103 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.102 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.101 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.100 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.99 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.98 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.97 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.96 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.95 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.94 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.93 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.92 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.91 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.90 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.89 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.88 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.87 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.86 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc
trackler-2.2.1.85 tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc