Skip to content

test: add tests to @stdlib/ndarray/base/nullary #2350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 57 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3538ad2
test(ndarray/base/nullary): add tests for nullary0d
headlessNode Jun 10, 2024
feeb626
test(ndarray/base/nullary): add tests for nullary1d
headlessNode Jun 10, 2024
cd48c03
test(ndarray/base/nullary): add tests for nullary2d
headlessNode Jun 10, 2024
8338c60
test(ndarray/base/nullary): add tests for nullary3d
headlessNode Jun 10, 2024
e536428
test(ndarray/base/nullary): add tests for nullary4d
headlessNode Jun 10, 2024
f3f5ca6
test(ndarray/base/nullary): add tests for nullary5d
headlessNode Jun 10, 2024
c422f32
test(ndarray/base/nullary): add tests for nullary6d
headlessNode Jun 10, 2024
0f87a70
test(ndarray/base/nullary): add tests for nullary7d
headlessNode Jun 10, 2024
f6c861b
test(ndarray/base/nullary): add tests for nullary8d
headlessNode Jun 10, 2024
e3f48e1
test(ndarray/base/nullary): add tests for nullary9d
headlessNode Jun 10, 2024
7b9aa26
test(ndarray/base/nullary): add tests for nullary10d
headlessNode Jun 10, 2024
3c14136
test(ndarray/base/nullary): add tests for nullarynd
headlessNode Jun 10, 2024
ce16425
test(ndarray/base/nullary): add some tests for edge-cases
headlessNode Jun 10, 2024
5fd1993
chore(ndarray/base/nullary): remove fixme comment from test file
headlessNode Jun 10, 2024
fc751e5
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into pr…
kgryte Jul 8, 2024
ca0d5cb
test: move 0d tests to separate file
kgryte Jul 8, 2024
b9b7894
test: move 1d tests to separate file
kgryte Jul 8, 2024
ace0f99
test: move 2d tests to separate file
kgryte Jul 8, 2024
658bdf2
test(ndarray/base/nullary): add tests for nullary0d
headlessNode Jun 10, 2024
f93fcf9
test(ndarray/base/nullary): add tests for nullary1d
headlessNode Jun 10, 2024
258d333
test(ndarray/base/nullary): add tests for nullary2d
headlessNode Jun 10, 2024
89ddf20
test(ndarray/base/nullary): add tests for nullary3d
headlessNode Jun 10, 2024
ed4e830
test(ndarray/base/nullary): add tests for nullary4d
headlessNode Jun 10, 2024
08c3ae3
test(ndarray/base/nullary): add tests for nullary5d
headlessNode Jun 10, 2024
4ab8905
test(ndarray/base/nullary): add tests for nullary6d
headlessNode Jun 10, 2024
a228d06
test(ndarray/base/nullary): add tests for nullary7d
headlessNode Jun 10, 2024
45c962f
test(ndarray/base/nullary): add tests for nullary8d
headlessNode Jun 10, 2024
6cf778b
test(ndarray/base/nullary): add tests for nullary9d
headlessNode Jun 10, 2024
6b21d25
test(ndarray/base/nullary): add tests for nullary10d
headlessNode Jun 10, 2024
7222b50
test(ndarray/base/nullary): add tests for nullarynd
headlessNode Jun 10, 2024
456e9b0
test(ndarray/base/nullary): add some tests for edge-cases
headlessNode Jun 10, 2024
3e9ad2b
chore(ndarray/base/nullary): remove fixme comment from test file
headlessNode Jun 10, 2024
733e706
test: move 0d tests to separate file
kgryte Jul 8, 2024
4f85adb
test: move 1d tests to separate file
kgryte Jul 8, 2024
1f4ef1e
test: move 2d tests to separate file
kgryte Jul 8, 2024
4b4c130
test: add 3d tests to a separate file
headlessNode Jul 11, 2024
c6e1d98
test: add 4d tests to a separate file
headlessNode Jul 11, 2024
a49bce5
test: add 5d tests to separate file
headlessNode Jul 11, 2024
31b7f2c
test: add 6d tests to a separate file
headlessNode Jul 11, 2024
246927a
test: add 7d tests to a separate file
headlessNode Jul 11, 2024
124d0c2
test: add 8d tests to a separate file
headlessNode Jul 11, 2024
4bdb31e
test: add 9d tests to a separate file
headlessNode Jul 11, 2024
7bf4ed9
test: add 10d tests to a separate file
headlessNode Jul 11, 2024
61a567c
test: add nd tests to a separate file
headlessNode Jul 11, 2024
617fb70
Merge branch 'stdlib-js:develop' into ndarray-nullary-tests
headlessNode Jul 11, 2024
08adacf
Merge branch 'ndarray-nullary-tests' of github.com:headlessNode/stdli…
headlessNode Jul 11, 2024
4eceec7
chore: delete redundant test.main.js file
headlessNode Jul 11, 2024
214f6f3
test: fix strides
kgryte Jul 14, 2024
39da4b9
test: fix strides
kgryte Jul 14, 2024
f7b0d08
test: fix strides
kgryte Jul 14, 2024
843fbfb
test: fix strides
kgryte Jul 14, 2024
7867326
test: fix descriptions
kgryte Jul 14, 2024
6358e00
test: fix strides
kgryte Jul 14, 2024
5b958e2
test: fix strides
kgryte Jul 14, 2024
6233c52
test: add tests to increase coverage
kgryte Jul 14, 2024
52f4925
test: add non-contiguous tests for large arrays
kgryte Jul 14, 2024
5518f05
test: add blocked accessor tests
kgryte Jul 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions lib/node_modules/@stdlib/ndarray/base/nullary/test/test.0d.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var tape = require( 'tape' );
var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' );
var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' );
var Complex128Array = require( '@stdlib/array/complex128' );
var Float64Array = require( '@stdlib/array/float64' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var constantFunction = require( '@stdlib/utils/constant-function' );
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
var nullary = require( './../lib' );


// TESTS //

tape( 'main export is a function', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof nullary, 'function', 'main export is a function');
t.end();
});

tape( 'the function applies a nullary callback to each indexed element of a 0-dimensional ndarray', function test( t ) {
var expected;
var x;

x = scalar2ndarray( 0.0, {
'dtype': 'float64'
});

nullary( [ x ], constantFunction( 10.0 ) );

expected = new Float64Array( [ 10.0 ] );
t.strictEqual( isSameFloat64Array( x.data, expected ), true, 'returns expected value' );

t.end();
});

tape( 'the function applies a nullary callback to each indexed element of a 0-dimensional ndarray (accessors)', function test( t ) {
var expected;
var x;

x = scalar2ndarray( new Complex128( 0.0, 0.0 ), {
'dtype': 'complex128'
});

nullary( [ x ], constantFunction( new Complex128( 10.0, 10.0 ) ) );

expected = new Complex128Array( [ 10.0, 10.0 ] );
t.strictEqual( isSameComplex128Array( x.data, expected ), true, 'returns expected value' );

t.end();
});
Loading
Loading