10
10
11
11
/* global describe, it */
12
12
13
- import 'should' ;
13
+ // import 'should';
14
14
15
15
import {
16
16
LT ,
@@ -56,6 +56,9 @@ import {
56
56
} from '../source' ;
57
57
58
58
describe ( `List data type` , function ( ) {
59
+
60
+ debugger ;
61
+
59
62
const lst1 = list ( 1 , 2 , 3 ) ;
60
63
const lst2 = list ( 4 , 5 , 6 ) ;
61
64
const lst3 = list ( ) ;
@@ -64,6 +67,8 @@ describe(`List data type`, function() {
64
67
const lst6 = list ( 1 , 1 , 4 , 4 , 9 , 9 , 6 , 6 , 3 , 3 , 8 , 8 , 7 , 7 , 5 , 5 , 2 , 2 , 10 , 10 ) ;
65
68
const lst7 = list ( 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 ) ;
66
69
const lst8 = list ( 20 , 19 , 18 , 17 , 16 , 15 , 14 , 13 , 12 , 11 , 10 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ) ;
70
+ const lst9 = listRange ( 10 , 0 ) ;
71
+ const lst10 = listRangeBy ( 10 , 0 , function ( x ) { return x - 1 } ) ;
67
72
const sorted = list ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) ;
68
73
const unsorted = list ( 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ) ;
69
74
const f = x => x * 10 ;
@@ -158,14 +163,18 @@ describe(`List data type`, function() {
158
163
} ) ;
159
164
} ) ;
160
165
describe ( `listRange()` , function ( ) {
161
- it ( `should build a list from a range of values` , function ( ) {
162
- lst4 . should . eql ( list ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) ) ;
166
+ it . only ( `should build a list from a range of values` , function ( ) {
167
+ //lst4.should.eql(list(0,1,2,3,4,5,6,7,8,9,10));
168
+ lst9 . should . eql ( list ( 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ) ) ;
169
+ } ) ;
170
+ it ( `should return a singleton list if the start and end values are the same` , function ( ) {
171
+ listRange ( 1 , 1 ) . should . eql ( list ( 1 ) ) ;
163
172
} ) ;
164
173
} ) ;
165
174
describe ( `listRangeBy()` , function ( ) {
166
175
it ( `should build a list from a range of values and using a custom step function` , function ( ) {
167
176
lst5 . should . eql ( list ( 0 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 ) ) ;
168
- listRangeBy ( 10 , 0 , x => x - 1 ) . should . eql ( list ( 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ) ) ;
177
+ lst10 . should . eql ( list ( 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ) ) ;
169
178
} ) ;
170
179
it ( `should return a singleton list if the start and end values are the same` , function ( ) {
171
180
listRangeBy ( 1 , 1 ) . should . eql ( list ( 1 ) ) ;
@@ -284,7 +293,7 @@ describe(`List data type`, function() {
284
293
} ) ;
285
294
} ) ;
286
295
describe ( `reverse()` , function ( ) {
287
- it ( `should ` , function ( ) {
296
+ it ( `should reverse a list ` , function ( ) {
288
297
reverse ( lst1 ) . should . eql ( list ( 3 , 2 , 1 ) ) ;
289
298
} ) ;
290
299
} ) ;
0 commit comments