File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
lib/node_modules/@stdlib/ndarray/fill-slice/test Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,40 @@ tape( 'the function throws an error if provided an options argument which is not
155
155
}
156
156
} ) ;
157
157
158
+ tape ( 'the function throws an error if provided a `strict` option which is not a boolean (multislice)' , function test ( t ) {
159
+ var values ;
160
+ var x ;
161
+ var s ;
162
+ var i ;
163
+
164
+ values = [
165
+ '5' ,
166
+ 5 ,
167
+ NaN ,
168
+ null ,
169
+ void 0 ,
170
+ [ ] ,
171
+ function noop ( ) { }
172
+ ] ;
173
+ x = scalar2ndarray ( 0.0 , {
174
+ 'dtype' : 'float64'
175
+ } ) ;
176
+ s = new MultiSlice ( null ) ;
177
+
178
+ for ( i = 0 ; i < values . length ; i ++ ) {
179
+ t . throws ( badValue ( values [ i ] ) , Error , 'throws an error when provided ' + values [ i ] ) ;
180
+ }
181
+ t . end ( ) ;
182
+
183
+ function badValue ( value ) {
184
+ return function badValue ( ) {
185
+ fillSlice ( x , 10.0 , s , {
186
+ 'strict' : value
187
+ } ) ;
188
+ } ;
189
+ }
190
+ } ) ;
191
+
158
192
tape ( 'the function fills an input ndarray slice with a specified value (row-major, contiguous)' , function test ( t ) {
159
193
var expected ;
160
194
var ord ;
You can’t perform that action at this time.
0 commit comments