2
2
3
3
describe ' Simple Linked List' , ->
4
4
describe ' Element class' , ->
5
- xit ' has constructor' , ->
5
+ it ' has constructor' , ->
6
6
element = new Element 1
7
7
expect (element .value ).toEqual 1
8
8
@@ -13,7 +13,7 @@ describe 'Simple Linked List', ->
13
13
xit ' has null for next by default' , ->
14
14
element = new Element 1
15
15
expect (element .next ).toEqual null
16
-
16
+
17
17
describe ' List class' , ->
18
18
xit ' has constructor' , ->
19
19
list = new LinkedList
@@ -69,23 +69,23 @@ describe 'Simple Linked List', ->
69
69
list .add element2
70
70
expect (list .head .next .value ).toEqual 1
71
71
72
- xit ' can be inxitialized wxith an array' , ->
72
+ xit ' can be initialized with an array' , ->
73
73
list = new LinkedList [1 , 2 , 3 ]
74
74
expect (list .length ()).toEqual 3
75
75
expect (list .head .value ).toEqual 3
76
76
77
- describe ' Lists wxith multiple elements' , ->
77
+ describe ' Lists with multiple elements' , ->
78
78
79
- xit ' wxith correct length' , ->
79
+ xit ' with correct length' , ->
80
80
list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
81
81
expect (list .length ()).toEqual 10
82
82
83
- xit ' wxith correct head value' , ->
84
- list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
83
+ xit ' with correct head value' , ->
84
+ list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
85
85
expect (list .head .value ).toEqual 10
86
86
87
87
xit ' can traverse the list' , ->
88
- list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
88
+ list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
89
89
expect (list .head .next .next .next .value ).toEqual 7
90
90
91
91
xit ' can convert to an array' , ->
@@ -95,23 +95,23 @@ describe 'Simple Linked List', ->
95
95
xit ' head of list is final element from input array' , ->
96
96
list = new LinkedList [1 , 2 ]
97
97
expect (list .head .value ).toEqual 2
98
-
98
+
99
99
xit ' can convert longer list to an array' , ->
100
- list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
100
+ list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
101
101
expect (list .toArray ()).toEqual [10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ]
102
102
103
103
xit ' can be reversed' , ->
104
104
list = new LinkedList [1 , 2 ]
105
105
expect (list .reverse ().toArray ()).toEqual [1 , 2 ]
106
106
107
- xit ' can be reversed when xit has more elements' , ->
107
+ xit ' can be reversed when it has more elements' , ->
108
108
list = new LinkedList [1 , 2 , 3 ]
109
109
expect (list .reverse ().toArray ()).toEqual [1 , 2 , 3 ]
110
110
111
111
xit ' can reverse with many elements' , ->
112
- list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
112
+ list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
113
113
expect (list .reverse ().toArray ()).toEqual [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
114
114
115
115
xit ' can reverse a reversal' , ->
116
- list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
116
+ list = new LinkedList [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
117
117
expect (list .reverse ().reverse ().toArray ()).toEqual [10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ]
0 commit comments