From 807daa319d8a7a14e90fd6c5202220810bfdf42a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 21 Jan 2024 00:36:48 +0000 Subject: [PATCH] Auto-generated commit --- base/at2d/test/test.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/base/at2d/test/test.js b/base/at2d/test/test.js index d6fd3220..3a0cea57 100644 --- a/base/at2d/test/test.js +++ b/base/at2d/test/test.js @@ -21,7 +21,9 @@ // MODULES // var tape = require( 'tape' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; var nCartesianProduct = require( './../../../base/n-cartesian-product' ); +var filled2dBy = require( './../../../base/filled2d-by' ); var flatten2d = require( './../../../base/flatten2d' ); var incrspace = require( './../../../base/incrspace' ); var at2d = require( './../lib' ); @@ -46,10 +48,7 @@ tape( 'the function returns a nested array element (positive indices)', function var i; shape = [ 2, 2 ]; - x = [ - [ 1, 2 ], - [ 3, 4 ] - ]; + x = filled2dBy( shape, discreteUniform( 0, 10 ) ); i0 = incrspace( 0, shape[0], 1 ); i1 = incrspace( 0, shape[1], 1 ); @@ -75,10 +74,7 @@ tape( 'the function returns a nested array element (negative indices)', function var i; shape = [ 2, 2 ]; - x = [ - [ 1, 2 ], - [ 3, 4 ] - ]; + x = filled2dBy( shape, discreteUniform( 0, 10 ) ); i0 = incrspace( -shape[0], 0, 1 ); i1 = incrspace( -shape[1], 0, 1 ); @@ -104,10 +100,7 @@ tape( 'the function returns `undefined` if provided an out-of-bounds index (posi var i; shape = [ 2, 2 ]; - x = [ - [ 1, 2 ], - [ 3, 4 ] - ]; + x = filled2dBy( shape, discreteUniform( 0, 10 ) ); i0 = incrspace( shape[0], shape[0]+10, 1 ); i1 = incrspace( shape[1], shape[1]+10, 1 ); @@ -133,10 +126,7 @@ tape( 'the function returns `undefined` if provided an out-of-bounds index (nega var i; shape = [ 2, 2 ]; - x = [ - [ 1, 2 ], - [ 3, 4 ] - ]; + x = filled2dBy( shape, discreteUniform( 0, 10 ) ); i0 = incrspace( -shape[0]-10, -shape[0], 1 ); i1 = incrspace( -shape[1]-10, -shape[1], 1 );