From 9d7d6b051ee076f90094efb711a0ebee1cdea871 Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Sun, 16 Mar 2025 10:48:00 +0000 Subject: [PATCH 1/4] fix: test cases in `strided/base/map-by2` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js | 2 +- .../@stdlib/strided/base/map-by2/test/test.ndarray.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js index 2dc8ff4d01b3..4713ab5d8a35 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js +++ b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js @@ -72,7 +72,7 @@ tape( 'the function applies a binary function to indexed strided array elements mapBy2( x.length, x, 1, y, 1, z, 1, add, accessor ); t.deepEqual( z, expected, 'deep equal' ); - x = new Array( 5 ); // sparse array + x = [ ]; // sparse array y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js index 3aa32c2a7c03..4f3a567c672a 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js @@ -72,7 +72,7 @@ tape( 'the function applies a binary function to indexed strided array elements mapBy2( x.length, x, 1, 0, y, 1, 0, z, 1, 0, add, accessor ); t.deepEqual( z, expected, 'deep equal' ); - x = new Array( 5 ); // sparse array + x = [ ]; // sparse array y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; From 4979cc93e6ca040ef22cc4aec59e2bc627e9475d Mon Sep 17 00:00:00 2001 From: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> Date: Mon, 17 Mar 2025 13:08:28 +0530 Subject: [PATCH 2/4] Update test.main.js Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> --- lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js index 4713ab5d8a35..42cb1711cd2d 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js +++ b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js @@ -73,6 +73,7 @@ tape( 'the function applies a binary function to indexed strided array elements t.deepEqual( z, expected, 'deep equal' ); x = [ ]; // sparse array + x.length = 5; y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; From b73ce84e547e9026a1132d763e59b535cb59148e Mon Sep 17 00:00:00 2001 From: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> Date: Mon, 17 Mar 2025 13:08:50 +0530 Subject: [PATCH 3/4] Update test.ndarray.js Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> --- .../@stdlib/strided/base/map-by2/test/test.ndarray.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js index 4f3a567c672a..27170d2bed38 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js @@ -73,6 +73,7 @@ tape( 'the function applies a binary function to indexed strided array elements t.deepEqual( z, expected, 'deep equal' ); x = [ ]; // sparse array + x.length = 5; y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; From bae506240202d97a828bdd49bdeb859400ca8637 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 17 Mar 2025 00:44:47 -0700 Subject: [PATCH 4/4] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/strided/base/map-by2/test/test.main.js | 4 ++-- .../@stdlib/strided/base/map-by2/test/test.ndarray.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js index 42cb1711cd2d..f728138a8afa 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js +++ b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.main.js @@ -72,8 +72,8 @@ tape( 'the function applies a binary function to indexed strided array elements mapBy2( x.length, x, 1, y, 1, z, 1, add, accessor ); t.deepEqual( z, expected, 'deep equal' ); - x = [ ]; // sparse array - x.length = 5; + // Create a sparse array: + x = new Array( 5 ); // eslint-disable-line stdlib/no-new-array y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js index 27170d2bed38..0b4290d8686a 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/strided/base/map-by2/test/test.ndarray.js @@ -72,8 +72,8 @@ tape( 'the function applies a binary function to indexed strided array elements mapBy2( x.length, x, 1, 0, y, 1, 0, z, 1, 0, add, accessor ); t.deepEqual( z, expected, 'deep equal' ); - x = [ ]; // sparse array - x.length = 5; + // Create a sparse array: + x = new Array( 5 ); // eslint-disable-line stdlib/no-new-array y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];