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 @@ -121,6 +121,40 @@ tape( 'the function throws an error if provided a second argument which cannot b
121
121
}
122
122
} ) ;
123
123
124
+ tape ( 'the function throws an error if provided an options argument which is not an object' , function test ( t ) {
125
+ var values ;
126
+ var x ;
127
+ var s ;
128
+ var i ;
129
+
130
+ values = [
131
+ '5' ,
132
+ 5 ,
133
+ NaN ,
134
+ true ,
135
+ false ,
136
+ null ,
137
+ void 0 ,
138
+ [ ] ,
139
+ function noop ( ) { }
140
+ ] ;
141
+ x = scalar2ndarray ( 0.0 , {
142
+ 'dtype' : 'float64'
143
+ } ) ;
144
+ s = new MultiSlice ( null ) ;
145
+
146
+ for ( i = 0 ; i < values . length ; i ++ ) {
147
+ t . throws ( badValue ( values [ i ] ) , Error , 'throws an error when provided ' + values [ i ] ) ;
148
+ }
149
+ t . end ( ) ;
150
+
151
+ function badValue ( value ) {
152
+ return function badValue ( ) {
153
+ fillSlice ( x , 10.0 , s , value ) ;
154
+ } ;
155
+ }
156
+ } ) ;
157
+
124
158
tape ( 'the function fills an input ndarray slice with a specified value (row-major, contiguous)' , function test ( t ) {
125
159
var expected ;
126
160
var ord ;
You can’t perform that action at this time.
0 commit comments