ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / base / test / common / history.test.ts 295 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
import assert from 'assert' ;
import { HistoryNavigator, HistoryNavigator2 } from '../../common/history.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from './utils.js' ;
suite ( 'History Navigator' , ( ) => {
ensureNoDisposablesAreLeakedInTestSuite ( ) ;
test ( 'create reduces the input to limit' , ( ) => {
const testObject = new HistoryNavigator ( new Set ( [ '1' ,
assert testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
testObject
testObject
assert testObject
testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
testObject
testObject
testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
testObject
assert testObject
testObject
assert testObject
testObject
assert testObject
assert testObject
historyNavigator HistoryNavigator
result
historyNavigator
historyNavigator
result historyNavigator
historyNavigator
result
testObject
assert testObject
assert testObject
assert
testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
testObject
assert testObject
assert testObject
assert testObject
'2'
,
'3'
,
'4'
]
)
,
2
)
;
.
deepStrictEqual
(
[
'3'
,
'4'
]
,
toArray
(
)
)
;
}
)
;
test
(
'create sets the position after last'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
100
)
;
.
strictEqual
(
.
current
(
)
,
null
)
;
.
strictEqual
(
.
isNowhere
(
)
,
true
)
;
.
strictEqual
(
.
isFirst
(
)
,
false
)
;
.
strictEqual
(
.
isLast
(
)
,
false
)
;
.
strictEqual
(
.
next
(
)
,
null
)
;
.
strictEqual
(
.
previous
(
)
,
'4'
)
;
.
strictEqual
(
.
isNowhere
(
)
,
false
)
;
.
strictEqual
(
.
isFirst
(
)
,
false
)
;
.
strictEqual
(
.
isLast
(
)
,
true
)
;
}
)
;
test
(
'last returns last element'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
100
)
;
.
strictEqual
(
.
first
(
)
,
'1'
)
;
.
strictEqual
(
.
last
(
)
,
'4'
)
;
.
strictEqual
(
.
isFirst
(
)
,
false
)
;
.
strictEqual
(
.
isLast
(
)
,
true
)
;
}
)
;
test
(
'first returns first element'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
3
)
;
.
strictEqual
(
'2'
,
.
first
(
)
)
;
.
strictEqual
(
.
isFirst
(
)
,
true
)
;
.
strictEqual
(
.
isLast
(
)
,
false
)
;
}
)
;
test
(
'next returns next element'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
3
)
;
.
first
(
)
;
.
strictEqual
(
.
next
(
)
,
'3'
)
;
.
strictEqual
(
.
next
(
)
,
'4'
)
;
.
strictEqual
(
.
next
(
)
,
null
)
;
}
)
;
test
(
'previous returns previous element'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
3
)
;
.
strictEqual
(
.
previous
(
)
,
'4'
)
;
.
strictEqual
(
.
previous
(
)
,
'3'
)
;
.
strictEqual
(
.
previous
(
)
,
'2'
)
;
.
strictEqual
(
.
previous
(
)
,
null
)
;
}
)
;
test
(
'next on last element returns null and remains on last'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
3
)
;
.
first
(
)
;
.
last
(
)
;
.
strictEqual
(
.
isLast
(
)
,
true
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
strictEqual
(
.
next
(
)
,
null
)
;
.
strictEqual
(
.
isLast
(
)
,
false
)
;
}
)
;
test
(
'previous on first element returns null and remains on first'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
3
)
;
.
first
(
)
;
.
strictEqual
(
.
isFirst
(
)
,
true
)
;
.
strictEqual
(
.
current
(
)
,
'2'
)
;
.
strictEqual
(
.
previous
(
)
,
null
)
;
.
strictEqual
(
.
isFirst
(
)
,
true
)
;
}
)
;
test
(
'add reduces the input to limit'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
2
)
;
.
add
(
'5'
)
;
.
deepStrictEqual
(
toArray
(
)
,
[
'4'
,
'5'
]
)
;
}
)
;
test
(
'adding existing element changes the position'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
5
)
;
.
add
(
'2'
)
;
.
deepStrictEqual
(
toArray
(
)
,
[
'1'
,
'3'
,
'4'
,
'2'
]
)
;
}
)
;
test
(
'add resets the navigator to last'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
,
3
)
;
.
first
(
)
;
.
add
(
'5'
)
;
.
strictEqual
(
.
previous
(
)
,
'5'
)
;
.
strictEqual
(
.
isLast
(
)
,
true
)
;
.
strictEqual
(
.
next
(
)
,
null
)
;
.
strictEqual
(
.
isLast
(
)
,
false
)
;
}
)
;
test
(
'adding an existing item changes the order'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
]
)
)
;
.
add
(
'1'
)
;
.
deepStrictEqual
(
[
'2'
,
'3'
,
'1'
]
,
toArray
(
)
)
;
}
)
;
test
(
'previous returns null if the current position is the first one'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
]
)
)
;
.
first
(
)
;
.
deepStrictEqual
(
.
previous
(
)
,
null
)
;
.
strictEqual
(
.
isFirst
(
)
,
true
)
;
}
)
;
test
(
'previous returns object if the current position is not the first one'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
]
)
)
;
.
first
(
)
;
.
next
(
)
;
.
deepStrictEqual
(
.
previous
(
)
,
'1'
)
;
}
)
;
test
(
'next returns null if the current position is the last one'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
]
)
)
;
.
last
(
)
;
.
strictEqual
(
.
isLast
(
)
,
true
)
;
.
deepStrictEqual
(
.
next
(
)
,
null
)
;
.
strictEqual
(
.
isLast
(
)
,
false
)
;
}
)
;
test
(
'next returns object if the current position is not the last one'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'1'
,
'2'
,
'3'
]
)
)
;
.
last
(
)
;
.
previous
(
)
;
.
deepStrictEqual
(
.
next
(
)
,
'3'
)
;
}
)
;
test
(
'clear'
,
(
)
=>
{
const
=
new
HistoryNavigator
(
new
Set
(
[
'a'
,
'b'
,
'c'
]
)
)
;
.
strictEqual
(
.
previous
(
)
,
'c'
)
;
.
clear
(
)
;
.
strictEqual
(
.
current
(
)
,
null
)
;
.
strictEqual
(
.
isNowhere
(
)
,
true
)
;
}
)
;
function
toArray
(
:
<
string
>
)
:
Array
<
string
|
null
>
{
const
:
Array
<
string
|
null
>
=
[
]
;
.
first
(
)
;
if
(
.
current
(
)
)
{
do
{
.
push
(
.
current
(
)
!
)
;
}
while
(
.
next
(
)
)
;
}
return
;
}
}
)
;
suite
(
'History Navigator 2'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'constructor'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
}
)
;
test
(
'constructor - initial history is not empty'
,
(
)
=>
{
.
throws
(
(
)
=>
new
HistoryNavigator2
(
[
]
)
)
;
}
)
;
test
(
'constructor - capacity limit'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
,
3
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
.
strictEqual
(
.
has
(
'1'
)
,
false
)
;
}
)
;
test
(
'constructor - duplicate values'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
,
'3'
,
'2'
,
'1'
]
)
;
.
strictEqual
(
.
current
(
)
,
'1'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
}
)
;
test
(
'navigation'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
.
strictEqual
(
.
next
(
)
,
'4'
)
;
.
strictEqual
(
.
previous
(
)
,
'3'
)
;
.
strictEqual
(
.
previous
(
)
,
'2'
)
;
.
strictEqual
(
.
previous
(
)
,
'1'
)
;
.
strictEqual
(
.
previous
(
)
,
'1'
)
;
.
strictEqual
(
.
current
(
)
,
'1'
)
;
.
strictEqual
(
.
next
(
)
,
'2'
)
;
.
strictEqual
(
.
resetCursor
(
)
,
'4'
)
;
}
)
;
test
(
'add'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
add
(
'5'
)
;
.
strictEqual
(
.
current
(
)
,
'5'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
}
)
;
test
(
'add - existing value'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
add
(
'2'
)
;
.
strictEqual
(
.
current
(
)
,
'2'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
.
strictEqual
(
.
previous
(
)
,
'4'
)
;
.
strictEqual
(
.
previous
(
)
,
'3'
)
;
.
strictEqual
(
.
previous
(
)
,
'1'
)
;
}
)
;
test
(
'replaceLast'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
replaceLast
(
'5'
)
;
.
strictEqual
(
.
current
(
)
,
'5'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
.
strictEqual
(
.
has
(
'4'
)
,
false
)
;
.
strictEqual
(
.
previous
(
)
,
'3'
)
;
.
strictEqual
(
.
previous
(
)
,
'2'
)
;
.
strictEqual
(
.
previous
(
)
,
'1'
)
;
}
)
;
test
(
'replaceLast - existing value'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
replaceLast
(
'2'
)
;
.
strictEqual
(
.
current
(
)
,
'2'
)
;
.
strictEqual
(
.
isAtEnd
(
)
,
true
)
;
.
strictEqual
(
.
has
(
'4'
)
,
false
)
;
.
strictEqual
(
.
previous
(
)
,
'3'
)
;
.
strictEqual
(
.
previous
(
)
,
'1'
)
;
}
)
;
test
(
'prepend'
,
(
)
=>
{
const
=
new
HistoryNavigator2
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
ok
(
.
isAtEnd
(
)
)
;
.
deepStrictEqual
(
Array
.
from
(
)
,
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
prepend
(
'0'
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
ok
(
.
isAtEnd
(
)
)
;
.
deepStrictEqual
(
Array
.
from
(
)
,
[
'0'
,
'1'
,
'2'
,
'3'
,
'4'
]
)
;
.
prepend
(
'2'
)
;
.
strictEqual
(
.
current
(
)
,
'4'
)
;
.
ok
(
.
isAtEnd
(
)
)
;
.
deepStrictEqual
(
Array
.
from
(
)
,
[
'0'
,
'1'
,
'2'
,
'3'
,
'4'
]
)
;
}
)
;
}
)
;