ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / contextkey / test / common / contextkey.test.ts 402 строк · изменён 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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
import assert from 'assert' ;
import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
import { ContextKeyExpr, ContextKeyExpression, implies } from '../../common/contextkey.js' ;
function createContext ( ctx: any ) {
return {
getValue : ( key: string ) => {
return ctx[ key]
a ContextKeyExpr
ContextKeyExpr
ContextKeyExpr ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
b ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr ContextKeyExpr
ContextKeyExpr
a b
expr ContextKeyExpression str
deserialized ContextKeyExpr str
assert expr
assert deserialized
assert expr deserialized str
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
key1IsTrue ContextKeyExpr
key1IsNotFalse ContextKeyExpr
key1IsFalse ContextKeyExpr
key1IsNotTrue ContextKeyExpr
assert key1IsTrue ContextKeyExpr
assert key1IsNotFalse ContextKeyExpr
assert key1IsFalse ContextKeyExpr
assert key1IsNotTrue ContextKeyExpr
context
expr expected
rules ContextKeyExpr expr
assert rules context expected expr
expr value
expr value
expr value
expr value
expr value
expr value
expr value
expr value
expr value
expr value
expr value
expr expected
actual ContextKeyExpr expr
assert actual expected
expr expected
actual ContextKeyExpr expr
assert actual expected
isMacintosh
isLinux
isWindows
expr1 expr2 expected
e1 ContextKeyExpr expr1
e2 ContextKeyExpr expr2
actual ContextKeyExpr e1 e2
assert actual expected
ainb ContextKeyExpr
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
isWindows
assert ainb
assert ainb
assert ainb
assert ainb
assert ainb
aNotInB ContextKeyExpr
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
assert aNotInB
isWindows
assert aNotInB
assert aNotInB
assert aNotInB
actual ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
expected ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
assert actual expected
expr ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
assert expr
expr ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
assert expr
expr ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
assert expr
expr ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
assert expr
expr ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
assert expr
assert expr
assert expr
assert expr
p0 q0
p ContextKeyExpr p0
q ContextKeyExpr q0
p q
assert
assert
p0 q0
p ContextKeyExpr p0
q ContextKeyExpr q0
p q
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
expr ctx expected
_expr ContextKeyExpr expr
assert _expr ctx expected
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
expr expected
a ContextKeyExpr expr
b a
assert b expected
actual ContextKeyExpr
assert actual
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
ContextKeyExpr
;
}
}
;
}
suite
(
'ContextKeyExpr'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'ContextKeyExpr.equals'
,
(
)
=>
{
const
=
.
and
(
.
has
(
'a1'
)
,
.
and
(
.
has
(
'and.a'
)
)
,
.
has
(
'a2'
)
,
.
regex
(
'd3'
,
/ d. * /
)
,
.
regex
(
'd4'
,
/ \* \* 3* /
)
,
.
equals
(
'b1'
,
'bb1'
)
,
.
equals
(
'b2'
,
'bb2'
)
,
.
notEquals
(
'c1'
,
'cc1'
)
,
.
notEquals
(
'c2'
,
'cc2'
)
,
.
not
(
'd1'
)
,
.
not
(
'd2'
)
)
!
;
const
=
.
and
(
.
equals
(
'b2'
,
'bb2'
)
,
.
notEquals
(
'c1'
,
'cc1'
)
,
.
not
(
'd1'
)
,
.
regex
(
'd4'
,
/ \* \* 3* /
)
,
.
notEquals
(
'c2'
,
'cc2'
)
,
.
has
(
'a2'
)
,
.
equals
(
'b1'
,
'bb1'
)
,
.
regex
(
'd3'
,
/ d. * /
)
,
.
has
(
'a1'
)
,
.
and
(
.
equals
(
'and.a'
,
true
)
)
,
.
not
(
'd2'
)
)
!
;
assert
(
.
equals
(
)
,
'expressions should be equal'
)
;
}
)
;
test
(
'issue #134942: Equals in comparator expressions'
,
(
)
=>
{
function
testEquals
(
:
|
undefined
,
:
string
)
:
void
{
const
=
.
deserialize
(
)
;
.
ok
(
)
;
.
ok
(
)
;
.
strictEqual
(
.
equals
(
)
,
true
,
)
;
}
testEquals
(
.
greater
(
'value'
,
0
)
,
'value > 0'
)
;
testEquals
(
.
greaterEquals
(
'value'
,
0
)
,
'value >= 0'
)
;
testEquals
(
.
smaller
(
'value'
,
0
)
,
'value < 0'
)
;
testEquals
(
.
smallerEquals
(
'value'
,
0
)
,
'value <= 0'
)
;
}
)
;
test
(
'normalize'
,
(
)
=>
{
const
=
.
equals
(
'key1'
,
true
)
;
const
=
.
notEquals
(
'key1'
,
false
)
;
const
=
.
equals
(
'key1'
,
false
)
;
const
=
.
notEquals
(
'key1'
,
true
)
;
.
ok
(
.
equals
(
.
has
(
'key1'
)
)
)
;
.
ok
(
.
equals
(
.
has
(
'key1'
)
)
)
;
.
ok
(
.
equals
(
.
not
(
'key1'
)
)
)
;
.
ok
(
.
equals
(
.
not
(
'key1'
)
)
)
;
}
)
;
test
(
'evaluate'
,
(
)
=>
{
const
=
createContext
(
{
'a'
:
true
,
'b'
:
false
,
'c'
:
'5'
,
'd'
:
'd'
}
)
;
function
testExpression
(
:
string
,
:
boolean
)
:
void
{
const
=
.
deserialize
(
)
;
.
strictEqual
(
!
.
evaluate
(
)
,
,
)
;
}
function
testBatch
(
:
string
,
:
any
)
:
void
{
testExpression
(
,
!
!
)
;
testExpression
(
+
' == true'
,
!
!
)
;
testExpression
(
+
' != true'
,
!
)
;
testExpression
(
+
' == false'
,
!
)
;
testExpression
(
+
' != false'
,
!
!
)
;
testExpression
(
+
' == 5'
,
==
<
any
>
'5'
)
;
testExpression
(
+
' != 5'
,
!=
<
any
>
'5'
)
;
testExpression
(
'!'
+
,
!
)
;
testExpression
(
+
' =~ /d.*/'
,
/ d. * /
.
test
(
)
)
;
testExpression
(
+
' =~ /D/i'
,
/ D / i
.
test
(
)
)
;
}
testBatch
(
'a'
,
true
)
;
testBatch
(
'b'
,
false
)
;
testBatch
(
'c'
,
'5'
)
;
testBatch
(
'd'
,
'd'
)
;
testBatch
(
'z'
,
undefined
)
;
testExpression
(
'true'
,
true
)
;
testExpression
(
'false'
,
false
)
;
testExpression
(
'a && !b'
,
true
&&
!
false
)
;
testExpression
(
'a && b'
,
true
&&
false
)
;
testExpression
(
'a && !b && c == 5'
,
true
&&
!
false
&&
'5'
===
'5'
)
;
testExpression
(
'd =~ /e.*/'
,
false
)
;
testExpression
(
'b && a || a'
,
true
)
;
testExpression
(
'a || b'
,
true
)
;
testExpression
(
'b || b'
,
false
)
;
testExpression
(
'b && a || a && b'
,
false
)
;
}
)
;
test
(
'negate'
,
(
)
=>
{
function
testNegate
(
:
string
,
:
string
)
:
void
{
const
=
.
deserialize
(
)
!
.
negate
(
)
.
serialize
(
)
;
.
strictEqual
(
,
)
;
}
testNegate
(
'true'
,
'false'
)
;
testNegate
(
'false'
,
'true'
)
;
testNegate
(
'a'
,
'!a'
)
;
testNegate
(
'a && b || c'
,
'!a && !c || !b && !c'
)
;
testNegate
(
'a && b || c || d'
,
'!a && !c && !d || !b && !c && !d'
)
;
testNegate
(
'!a && !b || !c && !d'
,
'a && c || a && d || b && c || b && d'
)
;
testNegate
(
'!a && !b || !c && !d || !e && !f'
,
'a && c && e || a && c && f || a && d && e || a && d && f || b && c && e || b && c && f || b && d && e || b && d && f'
)
;
}
)
;
test
(
'false, true'
,
(
)
=>
{
function
testNormalize
(
:
string
,
:
string
)
:
void
{
const
=
.
deserialize
(
)
!
.
serialize
(
)
;
.
strictEqual
(
,
)
;
}
testNormalize
(
'true'
,
'true'
)
;
testNormalize
(
'!true'
,
'false'
)
;
testNormalize
(
'false'
,
'false'
)
;
testNormalize
(
'!false'
,
'true'
)
;
testNormalize
(
'a && true'
,
'a'
)
;
testNormalize
(
'a && false'
,
'false'
)
;
testNormalize
(
'a || true'
,
'true'
)
;
testNormalize
(
'a || false'
,
'a'
)
;
testNormalize
(
'isMac'
,
?
'true'
:
'false'
)
;
testNormalize
(
'isLinux'
,
?
'true'
:
'false'
)
;
testNormalize
(
'isWindows'
,
?
'true'
:
'false'
)
;
}
)
;
test
(
'issue #101015: distribute OR'
,
(
)
=>
{
function
t
(
:
string
,
:
string
,
:
string
|
undefined
)
:
void
{
const
=
.
deserialize
(
)
;
const
=
.
deserialize
(
)
;
const
=
.
and
(
,
)
?.
serialize
(
)
;
.
strictEqual
(
,
)
;
}
t
(
'a'
,
'b'
,
'a && b'
)
;
t
(
'a || b'
,
'c'
,
'a && c || b && c'
)
;
t
(
'a || b'
,
'c || d'
,
'a && c || a && d || b && c || b && d'
)
;
t
(
'a || b'
,
'c && d'
,
'a && c && d || b && c && d'
)
;
t
(
'a || b'
,
'c && d || e'
,
'a && e || b && e || a && c && d || b && c && d'
)
;
}
)
;
test
(
'ContextKeyInExpr'
,
(
)
=>
{
const
=
.
deserialize
(
'a in b'
)
!
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
[
3
,
2
,
1
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
[
1
,
2
,
3
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
[
1
,
2
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
null
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
[
'x'
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
[
'y'
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
{
}
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
{
'x'
:
false
}
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
{
'x'
:
true
}
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'prototype'
,
'b'
:
{
}
}
)
)
,
false
)
;
if
(
)
{
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'file:///c%3A/Users/path/file.ts'
,
'b'
:
[
'file:///c%3A/users/path/file.ts'
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'file:///c%3A/users/path/file.ts'
,
'b'
:
[
'file:///c%3A/Users/path/file.ts'
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'file:///c%3A/Users/path/file.ts'
,
'b'
:
{
'file:///c%3A/users/path/file.ts'
:
true
}
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'git:/path/File.ts'
,
'b'
:
[
'git:/path/file.ts'
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'file:///c%3A/Users/path/file.ts'
,
'b'
:
[
'file:///c%3A/Users/path/file.ts'
]
}
)
)
,
true
)
;
}
}
)
;
test
(
'ContextKeyNotInExpr'
,
(
)
=>
{
const
=
.
deserialize
(
'a not in b'
)
!
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
[
3
,
2
,
1
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
[
1
,
2
,
3
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
[
1
,
2
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
3
,
'b'
:
null
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
[
'x'
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
[
'y'
]
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
{
}
}
)
)
,
true
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
{
'x'
:
false
}
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'x'
,
'b'
:
{
'x'
:
true
}
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'prototype'
,
'b'
:
{
}
}
)
)
,
true
)
;
if
(
)
{
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'file:///c%3A/Users/path/file.ts'
,
'b'
:
[
'file:///c%3A/users/path/file.ts'
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'file:///c%3A/users/path/file.ts'
,
'b'
:
[
'file:///c%3A/Users/path/file.ts'
]
}
)
)
,
false
)
;
.
strictEqual
(
.
evaluate
(
createContext
(
{
'a'
:
'git:/path/File.ts'
,
'b'
:
[
'git:/path/file.ts'
]
}
)
)
,
true
)
;
}
}
)
;
test
(
'issue #106524: distributing AND should normalize'
,
(
)
=>
{
const
=
.
and
(
.
or
(
.
has
(
'a'
)
,
.
has
(
'b'
)
)
,
.
has
(
'c'
)
)
;
const
=
.
or
(
.
and
(
.
has
(
'a'
)
,
.
has
(
'c'
)
)
,
.
and
(
.
has
(
'b'
)
,
.
has
(
'c'
)
)
)
;
.
strictEqual
(
!
.
equals
(
!
)
,
true
)
;
}
)
;
test
(
'issue #129625: Removes duplicated terms in OR expressions'
,
(
)
=>
{
const
=
.
or
(
.
has
(
'A'
)
,
.
has
(
'B'
)
,
.
has
(
'A'
)
)
!
;
.
strictEqual
(
.
serialize
(
)
,
'A || B'
)
;
}
)
;
test
(
'Resolves true constant OR expressions'
,
(
)
=>
{
const
=
.
or
(
.
has
(
'A'
)
,
.
not
(
'A'
)
)
!
;
.
strictEqual
(
.
serialize
(
)
,
'true'
)
;
}
)
;
test
(
'Resolves false constant AND expressions'
,
(
)
=>
{
const
=
.
and
(
.
has
(
'A'
)
,
.
not
(
'A'
)
)
!
;
.
strictEqual
(
.
serialize
(
)
,
'false'
)
;
}
)
;
test
(
'issue #129625: Removes duplicated terms in AND expressions'
,
(
)
=>
{
const
=
.
and
(
.
has
(
'A'
)
,
.
has
(
'B'
)
,
.
has
(
'A'
)
)
!
;
.
strictEqual
(
.
serialize
(
)
,
'A && B'
)
;
}
)
;
test
(
'issue #129625: Remove duplicated terms when negating'
,
(
)
=>
{
const
=
.
and
(
.
has
(
'A'
)
,
.
or
(
.
has
(
'B1'
)
,
.
has
(
'B2'
)
,
)
)
!
;
.
strictEqual
(
.
serialize
(
)
,
'A && B1 || A && B2'
)
;
.
strictEqual
(
.
negate
(
)
!
.
serialize
(
)
,
'!A || !A && !B1 || !A && !B2 || !B1 && !B2'
)
;
.
strictEqual
(
.
negate
(
)
!
.
negate
(
)
!
.
serialize
(
)
,
'A && B1 || A && B2'
)
;
.
strictEqual
(
.
negate
(
)
!
.
negate
(
)
!
.
negate
(
)
!
.
serialize
(
)
,
'!A || !A && !B1 || !A && !B2 || !B1 && !B2'
)
;
}
)
;
test
(
'issue #129625: remove redundant terms in OR expressions'
,
(
)
=>
{
function
strImplies
(
:
string
,
:
string
)
:
boolean
{
const
=
.
deserialize
(
)
!
;
const
=
.
deserialize
(
)
!
;
return
implies
(
,
)
;
}
.
strictEqual
(
strImplies
(
'a && b'
,
'a'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a'
,
'a && b'
)
,
false
)
;
}
)
;
test
(
'implies'
,
(
)
=>
{
function
strImplies
(
:
string
,
:
string
)
:
boolean
{
const
=
.
deserialize
(
)
!
;
const
=
.
deserialize
(
)
!
;
return
implies
(
,
)
;
}
.
strictEqual
(
strImplies
(
'a'
,
'a'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a'
,
'a || b'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a'
,
'a && b'
)
,
false
)
;
.
strictEqual
(
strImplies
(
'a'
,
'a && b || a && c'
)
,
false
)
;
.
strictEqual
(
strImplies
(
'a && b'
,
'a'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a && b'
,
'b'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a && b'
,
'a && b || c'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a || b'
,
'a || c'
)
,
false
)
;
.
strictEqual
(
strImplies
(
'a || b'
,
'a || b'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a && b'
,
'a && b'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'a || b'
,
'a || b || c'
)
,
true
)
;
.
strictEqual
(
strImplies
(
'c && a && b'
,
'c && a'
)
,
true
)
;
}
)
;
test
(
'Greater, GreaterEquals, Smaller, SmallerEquals evaluate'
,
(
)
=>
{
function
checkEvaluate
(
:
string
,
:
any
,
:
any
)
:
void
{
const
=
.
deserialize
(
)
!
;
.
strictEqual
(
.
evaluate
(
createContext
(
)
)
,
)
;
}
checkEvaluate
(
'a > 1'
,
{
}
,
false
)
;
checkEvaluate
(
'a > 1'
,
{
:
0
}
,
false
)
;
checkEvaluate
(
'a > 1'
,
{
:
1
}
,
false
)
;
checkEvaluate
(
'a > 1'
,
{
:
2
}
,
true
)
;
checkEvaluate
(
'a > 1'
,
{
:
'0'
}
,
false
)
;
checkEvaluate
(
'a > 1'
,
{
:
'1'
}
,
false
)
;
checkEvaluate
(
'a > 1'
,
{
:
'2'
}
,
true
)
;
checkEvaluate
(
'a > 1'
,
{
:
'a'
}
,
false
)
;
checkEvaluate
(
'a > 10'
,
{
:
2
}
,
false
)
;
checkEvaluate
(
'a > 10'
,
{
:
11
}
,
true
)
;
checkEvaluate
(
'a > 10'
,
{
:
'11'
}
,
true
)
;
checkEvaluate
(
'a > 10'
,
{
:
'2'
}
,
false
)
;
checkEvaluate
(
'a > 10'
,
{
:
'11'
}
,
true
)
;
checkEvaluate
(
'a > 1.1'
,
{
:
1
}
,
false
)
;
checkEvaluate
(
'a > 1.1'
,
{
:
2
}
,
true
)
;
checkEvaluate
(
'a > 1.1'
,
{
:
11
}
,
true
)
;
checkEvaluate
(
'a > 1.1'
,
{
:
'1.1'
}
,
false
)
;
checkEvaluate
(
'a > 1.1'
,
{
:
'2'
}
,
true
)
;
checkEvaluate
(
'a > 1.1'
,
{
:
'11'
}
,
true
)
;
checkEvaluate
(
'a > b'
,
{
:
'b'
}
,
false
)
;
checkEvaluate
(
'a > b'
,
{
:
'c'
}
,
false
)
;
checkEvaluate
(
'a > b'
,
{
:
1000
}
,
false
)
;
checkEvaluate
(
'a >= 2'
,
{
:
'1'
}
,
false
)
;
checkEvaluate
(
'a >= 2'
,
{
:
'2'
}
,
true
)
;
checkEvaluate
(
'a >= 2'
,
{
:
'3'
}
,
true
)
;
checkEvaluate
(
'a < 2'
,
{
:
'1'
}
,
true
)
;
checkEvaluate
(
'a < 2'
,
{
:
'2'
}
,
false
)
;
checkEvaluate
(
'a < 2'
,
{
:
'3'
}
,
false
)
;
checkEvaluate
(
'a <= 2'
,
{
:
'1'
}
,
true
)
;
checkEvaluate
(
'a <= 2'
,
{
:
'2'
}
,
true
)
;
checkEvaluate
(
'a <= 2'
,
{
:
'3'
}
,
false
)
;
}
)
;
test
(
'Greater, GreaterEquals, Smaller, SmallerEquals negate'
,
(
)
=>
{
function
checkNegate
(
:
string
,
:
string
)
:
void
{
const
=
.
deserialize
(
)
!
;
const
=
.
negate
(
)
;
.
strictEqual
(
.
serialize
(
)
,
)
;
}
checkNegate
(
'a > 1'
,
'a <= 1'
)
;
checkNegate
(
'a > 1.1'
,
'a <= 1.1'
)
;
checkNegate
(
'a > b'
,
'a <= b'
)
;
checkNegate
(
'a >= 1'
,
'a < 1'
)
;
checkNegate
(
'a >= 1.1'
,
'a < 1.1'
)
;
checkNegate
(
'a >= b'
,
'a < b'
)
;
checkNegate
(
'a < 1'
,
'a >= 1'
)
;
checkNegate
(
'a < 1.1'
,
'a >= 1.1'
)
;
checkNegate
(
'a < b'
,
'a >= b'
)
;
checkNegate
(
'a <= 1'
,
'a > 1'
)
;
checkNegate
(
'a <= 1.1'
,
'a > 1.1'
)
;
checkNegate
(
'a <= b'
,
'a > b'
)
;
}
)
;
test
(
'issue #111899: context keys can use `<` or `>` '
,
(
)
=>
{
const
=
.
deserialize
(
'editorTextFocus && vim.active && vim.use<C-r>'
)
!
;
.
ok
(
.
equals
(
.
and
(
.
has
(
'editorTextFocus'
)
,
.
has
(
'vim.active'
)
,
.
has
(
'vim.use<C-r>'
)
,
)
!
)
)
;
}
)
;
}
)
;