23
23
var tape = require ( 'tape' ) ;
24
24
var hasProp = require ( '@stdlib/assert/has-property' ) ;
25
25
var isFunction = require ( '@stdlib/assert/is-function' ) ;
26
- var namedtypetuple = require ( './../lib' ) ;
26
+ var namedtypedtuple = require ( './../lib' ) ;
27
27
28
28
29
29
// TESTS //
30
30
31
31
tape ( 'main export is a function' , function test ( t ) {
32
32
t . ok ( true , __filename ) ;
33
- t . strictEqual ( typeof namedtypetuple , 'function' , 'main export is a function' ) ;
33
+ t . strictEqual ( typeof namedtypedtuple , 'function' , 'main export is a function' ) ;
34
34
t . end ( ) ;
35
35
} ) ;
36
36
37
37
tape ( 'a tuple has a `copyWithin` method for copying a sequence of tuple elements within a tuple' , function test ( t ) {
38
38
var Point ;
39
39
var p ;
40
40
41
- Point = namedtypetuple ( [ 'x' , 'y' ] ) ;
41
+ Point = namedtypedtuple ( [ 'x' , 'y' ] ) ;
42
42
p = new Point ( ) ;
43
43
44
- t . strictEqual ( hasProp ( p , 'copyWithin' ) , true , 'has property ' ) ;
45
- t . strictEqual ( isFunction ( p . copyWithin ) , true , 'has method ' ) ;
44
+ t . strictEqual ( hasProp ( p , 'copyWithin' ) , true , 'returns expected value ' ) ;
45
+ t . strictEqual ( isFunction ( p . copyWithin ) , true , 'returns expected value ' ) ;
46
46
t . end ( ) ;
47
47
} ) ;
48
48
49
- tape ( 'the method throws an error if invoked with a `this` context which is not a typed array instance' , function test ( t ) {
49
+ tape ( 'the method throws an error if invoked with a `this` context which is not a tuple instance' , function test ( t ) {
50
50
var values ;
51
51
var Point ;
52
52
var p ;
53
53
var i ;
54
54
55
- Point = namedtypetuple ( [ 'x' , 'y' ] ) ;
55
+ Point = namedtypedtuple ( [ 'x' , 'y' ] ) ;
56
56
p = new Point ( ) ;
57
57
58
58
values = [
@@ -78,13 +78,13 @@ tape( 'the method throws an error if invoked with a `this` context which is not
78
78
}
79
79
} ) ;
80
80
81
- tape ( 'the method throws an error if invoked with a `this` context which is not a typed array instance (end)' , function test ( t ) {
81
+ tape ( 'the method throws an error if invoked with a `this` context which is not a tuple instance (end)' , function test ( t ) {
82
82
var values ;
83
83
var Point ;
84
84
var p ;
85
85
var i ;
86
86
87
- Point = namedtypetuple ( [ 'x' , 'y' ] ) ;
87
+ Point = namedtypedtuple ( [ 'x' , 'y' ] ) ;
88
88
p = new Point ( ) ;
89
89
90
90
values = [
@@ -123,7 +123,7 @@ tape( 'the method copies a sequence of elements within a tuple', function test(
123
123
4.0
124
124
] ;
125
125
126
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
126
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
127
127
p = new Point ( arr ) ;
128
128
129
129
p . copyWithin ( 0 , 3 ) ;
@@ -153,7 +153,7 @@ tape( 'the method copies a sequence of elements within a tuple (negative target)
153
153
4.0
154
154
] ;
155
155
156
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
156
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
157
157
p = new Point ( arr ) ;
158
158
159
159
p . copyWithin ( - p . length , 3 ) ;
@@ -183,7 +183,7 @@ tape( 'the method copies a sequence of elements within a tuple (negative start)'
183
183
4.0
184
184
] ;
185
185
186
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
186
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
187
187
p = new Point ( arr ) ;
188
188
189
189
p . copyWithin ( 0 , - 2 ) ;
@@ -213,7 +213,7 @@ tape( 'the method copies a sequence of elements within a tuple (end=length)', fu
213
213
4.0
214
214
] ;
215
215
216
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
216
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
217
217
p = new Point ( arr ) ;
218
218
219
219
p . copyWithin ( 0 , 3 , p . length ) ;
@@ -243,7 +243,7 @@ tape( 'the method copies a sequence of elements within a tuple (non-inclusive en
243
243
4.0
244
244
] ;
245
245
246
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
246
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
247
247
p = new Point ( arr ) ;
248
248
249
249
p . copyWithin ( 2 , 0 , 2 ) ;
@@ -275,7 +275,7 @@ tape( 'the method copies a sequence of elements within a tuple (negative end)',
275
275
4.0
276
276
] ;
277
277
278
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
278
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
279
279
p = new Point ( arr ) ;
280
280
281
281
p . copyWithin ( 2 , 0 , - 3 ) ;
@@ -307,7 +307,7 @@ tape( 'the method copies a sequence of elements within a tuple (target >= length
307
307
4.0
308
308
] ;
309
309
310
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
310
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
311
311
p = new Point ( arr ) ;
312
312
313
313
p . copyWithin ( p . length , 3 ) ;
@@ -335,7 +335,7 @@ tape( 'the method copies a sequence of elements within a tuple (target > start)'
335
335
4.0
336
336
] ;
337
337
338
- Point = namedtypetuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
338
+ Point = namedtypedtuple ( [ 'x' , 'y' , 'z' , 'w' , 'v' ] ) ;
339
339
p = new Point ( arr ) ;
340
340
341
341
p . copyWithin ( 2 , 0 ) ;
0 commit comments