@@ -73,8 +73,11 @@ tape( 'the function interchanges two one-dimensional ndarrays', function test( t
7373
7474 v = dswap ( [ x , y ] ) ;
7575
76- expected = new Float64Array ( [ 1 .0, 2 .0, 3 .0, 4 .0, 5 .0 ] ) ;
76+ expected = new Float64Array ( [ 6 .0, 7 .0, 8 .0, 9 .0, 10 .0 ] ) ;
7777 t . strictEqual ( v , y , 'returns expected value' ) ;
78+ t . strictEqual ( isSameFloat64Array ( getData ( x ) , expected ) , true , 'returns expected value' ) ;
79+
80+ expected = new Float64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ] ) ;
7881 t . strictEqual ( isSameFloat64Array ( getData ( v ) , expected ) , true , 'returns expected value' ) ;
7982
8083 xbuf = new Float64Array ( [ 1.0 , 2.0 ] ) ;
@@ -84,14 +87,17 @@ tape( 'the function interchanges two one-dimensional ndarrays', function test( t
8487
8588 v = dswap ( [ x , y ] ) ;
8689
87- expected = new Float64Array ( [ 1 .0, 2 .0 ] ) ;
90+ expected = new Float64Array ( [ 3 .0, 4 .0 ] ) ;
8891 t . strictEqual ( v , y , 'returns expected value' ) ;
92+ t . strictEqual ( isSameFloat64Array ( getData ( x ) , expected ) , true , 'returns expected value' ) ;
93+
94+ expected = new Float64Array ( [ 1.0 , 2.0 ] ) ;
8995 t . strictEqual ( isSameFloat64Array ( getData ( v ) , expected ) , true , 'returns expected value' ) ;
9096
9197 t . end ( ) ;
9298} ) ;
9399
94- tape ( 'if provided empty ndarrays, the function returns the output ndarray unchanged' , function test ( t ) {
100+ tape ( 'if provided empty ndarrays, the function leaves both ndarrays unchanged' , function test ( t ) {
95101 var expected ;
96102 var xbuf ;
97103 var ybuf ;
@@ -108,6 +114,7 @@ tape( 'if provided empty ndarrays, the function returns the output ndarray uncha
108114
109115 expected = new Float64Array ( [ ] ) ;
110116 t . strictEqual ( v , y , 'returns expected value' ) ;
117+ t . strictEqual ( isSameFloat64Array ( getData ( x ) , expected ) , true , 'returns expected value' ) ;
111118 t . strictEqual ( isSameFloat64Array ( getData ( v ) , expected ) , true , 'returns expected value' ) ;
112119
113120 t . end ( ) ;
@@ -141,8 +148,11 @@ tape( 'the function supports one-dimensional ndarrays having non-unit strides',
141148
142149 v = dswap ( [ x , y ] ) ;
143150
144- expected = new Float64Array ( [ 1 .0, 3 .0, 5 .0, 9 .0, 10 .0 ] ) ;
151+ expected = new Float64Array ( [ 6 .0, 2 .0, 7 .0, 4 .0, 8 .0 ] ) ;
145152 t . strictEqual ( v , y , 'returns expected value' ) ;
153+ t . strictEqual ( isSameFloat64Array ( getData ( x ) , expected ) , true , 'returns expected value' ) ;
154+
155+ expected = new Float64Array ( [ 1.0 , 3.0 , 5.0 , 9.0 , 10.0 ] ) ;
146156 t . strictEqual ( isSameFloat64Array ( getData ( v ) , expected ) , true , 'returns expected value' ) ;
147157 t . end ( ) ;
148158} ) ;
@@ -175,8 +185,11 @@ tape( 'the function supports one-dimensional ndarrays having negative strides',
175185
176186 v = dswap ( [ x , y ] ) ;
177187
178- expected = new Float64Array ( [ 1 .0, 3 .0, 5 .0, 9 .0, 10 .0 ] ) ;
188+ expected = new Float64Array ( [ 6 .0, 2 .0, 7 .0, 4 .0, 8 .0 ] ) ;
179189 t . strictEqual ( v , y , 'returns expected value' ) ;
190+ t . strictEqual ( isSameFloat64Array ( getData ( x ) , expected ) , true , 'returns expected value' ) ;
191+
192+ expected = new Float64Array ( [ 1.0 , 3.0 , 5.0 , 9.0 , 10.0 ] ) ;
180193 t . strictEqual ( isSameFloat64Array ( getData ( v ) , expected ) , true , 'returns expected value' ) ;
181194 t . end ( ) ;
182195} ) ;
@@ -215,8 +228,11 @@ tape( 'the function supports one-dimensional ndarrays having non-zero offsets',
215228
216229 v = dswap ( [ x , y ] ) ;
217230
218- expected = new Float64Array ( [ 0.0 , 0 .0, 1 .0, 2 .0, 3 .0, 4 .0, 0.0 , 0 .0 ] ) ;
231+ expected = new Float64Array ( [ 0.0 , 5 .0, 0 .0, 6 .0, 0 .0, 7 .0, 0.0 , 8 .0 ] ) ;
219232 t . strictEqual ( v , y , 'returns expected value' ) ;
233+ t . strictEqual ( isSameFloat64Array ( getData ( x ) , expected ) , true , 'returns expected value' ) ;
234+
235+ expected = new Float64Array ( [ 0.0 , 0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 0.0 , 0.0 ] ) ;
220236 t . strictEqual ( isSameFloat64Array ( getData ( v ) , expected ) , true , 'returns expected value' ) ;
221237 t . end ( ) ;
222238} ) ;
0 commit comments