From df82d6bf8d83bc23628206efb860ee871d09f84d Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Tue, 13 May 2025 17:47:15 +0000 Subject: [PATCH] feat: add stats/array/nanmean --- 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: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/stats/array/nanmean/README.md | 117 +++++++++++ .../array/nanmean/benchmark/benchmark.js | 104 ++++++++++ .../@stdlib/stats/array/nanmean/docs/repl.txt | 25 +++ .../stats/array/nanmean/docs/types/index.d.ts | 47 +++++ .../stats/array/nanmean/docs/types/test.ts | 51 +++++ .../stats/array/nanmean/examples/index.js | 37 ++++ .../@stdlib/stats/array/nanmean/lib/index.js | 42 ++++ .../@stdlib/stats/array/nanmean/lib/main.js | 69 +++++++ .../@stdlib/stats/array/nanmean/package.json | 68 +++++++ .../@stdlib/stats/array/nanmean/test/test.js | 188 ++++++++++++++++++ 10 files changed, 748 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/README.md create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/package.json create mode 100644 lib/node_modules/@stdlib/stats/array/nanmean/test/test.js diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/README.md b/lib/node_modules/@stdlib/stats/array/nanmean/README.md new file mode 100644 index 000000000000..3a7498ec0044 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/README.md @@ -0,0 +1,117 @@ + + +# nanmean + +> Calculate the [arithmetic mean][arithmetic-mean] of an array, ignoring `NaN` values. + +
+ +
+ + + +
+ +## Usage + +```javascript +var nanmean = require( '@stdlib/stats/array/nanmean' ); +``` + +#### nanmean( x ) + +Computes the [arithmetic mean][arithmetic-mean] of an array, ignoring `NaN` values. + +```javascript +var x = [ 1.0, -2.0, NaN, 2.0 ]; + +var v = nanmean( x ); +// returns ~0.3333 +``` + +The function has the following parameters: + +- **x**: input array. + +
+ + + +
+ +## Notes + +- If provided an empty array, the function returns `NaN`. +- The function supports array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]). + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var nanmean = require( '@stdlib/stats/array/nanmean' ); + +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -50.0, 50.0 ); +} + +var x = filledarrayBy( 10, 'float64', rand ); +console.log( x ); + +var v = nanmean( x ); +console.log( v ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/array/nanmean/benchmark/benchmark.js new file mode 100644 index 000000000000..580388707197 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/benchmark/benchmark.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var nanmean = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = filledarrayBy( len, 'generic', rand ); + return benchmark; + + function benchmark( b ) { + var v; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = nanmean( x ); + if ( isnan( v ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( v ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':len='+len, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/docs/repl.txt b/lib/node_modules/@stdlib/stats/array/nanmean/docs/repl.txt new file mode 100644 index 000000000000..fcb0c0c269bb --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/docs/repl.txt @@ -0,0 +1,25 @@ + +{{alias}}( x ) + Computes the arithmetic mean of an array, ignoring `NaN` values. + + If provided an empty array, the function returns `NaN`. + + Parameters + ---------- + x: Array|TypedArray + Input array. + + Returns + ------- + out: number + Arithmetic mean. + + Examples + -------- + > var x = [ 1.0, -2.0, NaN, 2.0 ]; + > {{alias}}( x ) + ~0.3333 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/array/nanmean/docs/types/index.d.ts new file mode 100644 index 000000000000..0d42a2f3f0e2 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/docs/types/index.d.ts @@ -0,0 +1,47 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +// TypeScript Version: 4.1 + +/// + +import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array'; + +/** +* Input array. +*/ +type InputArray = NumericArray | Collection | AccessorArrayLike; + +/** +* Computes the arithmetic mean of an array, ignoring `NaN` values. +* +* @param x - input array +* @returns arithmetic mean +* +* @example +* var x = [ 1.0, -2.0, NaN, 2.0 ]; +* +* var v = nanmean( x ); +* // returns ~0.3333 +*/ +declare function nanmean( x: InputArray ): number; + + +// EXPORTS // + +export = nanmean; diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/docs/types/test.ts b/lib/node_modules/@stdlib/stats/array/nanmean/docs/types/test.ts new file mode 100644 index 000000000000..b633c2a94b1b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/docs/types/test.ts @@ -0,0 +1,51 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +import AccessorArray = require( '@stdlib/array/base/accessor' ); +import nanmean = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const x = new Float64Array( 10 ); + + nanmean( x ); // $ExpectType number + nanmean( new AccessorArray( x ) ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a numeric array... +{ + nanmean( 10 ); // $ExpectError + nanmean( '10' ); // $ExpectError + nanmean( true ); // $ExpectError + nanmean( false ); // $ExpectError + nanmean( null ); // $ExpectError + nanmean( undefined ); // $ExpectError + nanmean( {} ); // $ExpectError + nanmean( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + nanmean(); // $ExpectError + nanmean( x, {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/examples/index.js b/lib/node_modules/@stdlib/stats/array/nanmean/examples/index.js new file mode 100644 index 000000000000..30d4f6a6c413 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/examples/index.js @@ -0,0 +1,37 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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'; + +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var nanmean = require( './../lib' ); + +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -50.0, 50.0 ); +} + +var x = filledarrayBy( 10, 'float64', rand ); +console.log( x ); + +var v = nanmean( x ); +console.log( v ); diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/lib/index.js b/lib/node_modules/@stdlib/stats/array/nanmean/lib/index.js new file mode 100644 index 000000000000..339082876377 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/lib/index.js @@ -0,0 +1,42 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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'; + +/** +* Compute the arithmetic mean of an array, ignoring `NaN` values. +* +* @module @stdlib/stats/array/nanmean +* +* @example +* var nanmean = require( '@stdlib/stats/array/nanmean' ); +* +* var x = [ 1.0, -2.0, NaN, 2.0 ]; +* +* var v = nanmean( x ); +* // returns ~0.3333 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/lib/main.js b/lib/node_modules/@stdlib/stats/array/nanmean/lib/main.js new file mode 100644 index 000000000000..520aa6b7f3f5 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/lib/main.js @@ -0,0 +1,69 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 isCollection = require( '@stdlib/assert/is-collection' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var dtype = require( '@stdlib/array/dtype' ); +var contains = require( '@stdlib/array/base/assert/contains' ); +var join = require( '@stdlib/array/base/join' ); +var strided = require( '@stdlib/stats/base/nanmean' ).ndarray; +var format = require( '@stdlib/string/format' ); + + +// VARIABLES // + +var IDTYPES = dtypes( 'real_and_generic' ); +var GENERIC_DTYPE = 'generic'; + + +// MAIN // + +/** +* Computes the arithmetic mean of an array, ignoring `NaN` values. +* +* @param {NumericArray} x - input array +* @throws {TypeError} first argument must be an array-like object +* @throws {TypeError} first argument must have a supported data type +* @returns {number} arithmetic mean +* +* @example +* var x = [ 1.0, -2.0, NaN, 2.0 ]; +* +* var v = nanmean( x ); +* // returns ~0.3333 +*/ +function nanmean( x ) { + var dt; + if ( !isCollection( x ) ) { + throw new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', x ) ); + } + dt = dtype( x ) || GENERIC_DTYPE; + if ( !contains( IDTYPES, dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.', join( IDTYPES, '", "' ), dt ) ); + } + return strided( x.length, x, 1, 0 ); +} + + +// EXPORTS // + +module.exports = nanmean; diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/package.json b/lib/node_modules/@stdlib/stats/array/nanmean/package.json new file mode 100644 index 000000000000..b91eea452234 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/stats/array/nanmean", + "version": "0.0.0", + "description": "Calculate the arithmetic mean of an array, ignoring NaN values.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "statistics", + "stats", + "mathematics", + "math", + "average", + "avg", + "mean", + "arithmetic mean", + "central tendency", + "domain", + "extent", + "array" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/stats/array/nanmean/test/test.js b/lib/node_modules/@stdlib/stats/array/nanmean/test/test.js new file mode 100644 index 000000000000..6ff707009403 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/array/nanmean/test/test.js @@ -0,0 +1,188 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); +var BooleanArray = require( '@stdlib/array/bool' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var nanmean = require( './../lib/main.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof nanmean, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( nanmean.length, 1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not an array-like object', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + nanmean( value ); + }; + } +}); + +tape( 'the function throws an error if provided a first argument which has an unsupported data type', function test( t ) { + var values; + var i; + + values = [ + new BooleanArray( 4 ), + new Complex128Array( 4 ) + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + nanmean( value ); + }; + } +}); + +tape( 'the function calculates the arithmetic mean of an array', function test( t ) { + var x; + var v; + + x = [ 1.0, -2.0, -4.0, 5.0, 0.0, 3.0, NaN, NaN ]; + v = nanmean( x ); + t.strictEqual( v, 3.0, 'returns expected value' ); + + x = [ -4.0, NaN, -5.0 ]; + v = nanmean( x ); + t.strictEqual( v, -4.5, 'returns expected value' ); + + x = [ -0.0, NaN, 0.0, -0.0 ]; + v = nanmean( x ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); + + x = [ NaN ]; + v = nanmean( x ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + x = [ NaN, NaN ]; + v = nanmean( x ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function calculates the maximum value of an array (accessors)', function test( t ) { + var x; + var v; + + x = [ 1.0, -2.0, -4.0, 5.0, 0.0, 3.0, NaN, NaN ]; + v = nanmean( toAccessorArray( x ) ); + t.strictEqual( v, 3.0, 'returns expected value' ); + + x = [ -4.0, NaN, -5.0 ]; + v = nanmean( toAccessorArray( x ) ); + t.strictEqual( v, -4.5, 'returns expected value' ); + + x = [ -0.0, NaN, 0.0, -0.0 ]; + v = nanmean( toAccessorArray( x ) ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); + + x = [ NaN ]; + v = nanmean( toAccessorArray( x ) ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + x = [ NaN, NaN ]; + v = nanmean( toAccessorArray( x ) ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function calculates the maximum value of an array (array-like object)', function test( t ) { + var x; + var v; + + x = { + 'length': 7, + '0': 1.0, + '1': -2.0, + '2': -4.0, + '3': NaN, + '4': 5.0, + '5': 0.0, + '6': 3.0 + }; + v = nanmean( x ); + t.strictEqual( v, 3.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an empty array, the function returns `NaN`', function test( t ) { + var v = nanmean( [] ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided an empty array, the function returns `NaN` (accessors)', function test( t ) { + var v = nanmean( toAccessorArray( [] ) ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided an array containing a single element, the function returns the first element', function test( t ) { + var v = nanmean( [ 1.0 ] ); + t.strictEqual( v, 1.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided an array containing a single element, the function returns the first element (accessors)', function test( t ) { + var v = nanmean( toAccessorArray( [ 1.0 ] ) ); + t.strictEqual( v, 1.0, 'returns expected value' ); + t.end(); +});