ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / url / test / common / urlGlob.test.ts 129 строк · изменён 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
import assert from 'assert' ;
import { URI } from '../../../../base/common/uri.js' ;
import { testUrlMatchesGlob } from '../../common/urlGlob.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
suite ( 'urlGlob' , ( ) => {
ensureNoDisposablesAreLeakedInTestSuite ( ) ;
suite ( 'testUrlMatchesGlob' , ( ) => {
test ( 'exact match' , (
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
uri
assert uri
assert uri
assert
assert
assert
assert
assert
assert
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'http://example.com'
,
'http://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path'
,
'https://example.com/path'
)
,
true
)
;
}
)
;
test
(
'trailing slashes are ignored'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/'
,
'https://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com/'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com//'
,
'https://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path/'
,
'https://example.com/path'
)
,
true
)
;
}
)
;
test
(
'query and fragment are ignored'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com?query=value'
,
'https://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com#fragment'
,
'https://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com?query=value#fragment'
,
'https://example.com'
)
,
true
)
;
}
)
;
test
(
'scheme matching'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'http://example.com'
,
'https://example.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'ftp://example.com'
,
'https://example.com'
)
,
false
)
;
}
)
;
test
(
'glob without scheme assumes http/https'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'http://example.com'
,
'example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'ftp://example.com'
,
'example.com'
)
,
false
)
;
}
)
;
test
(
'wildcard matching in path'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/anything'
,
'https://example.com/*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path/to/resource'
,
'https://example.com/*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path/to/resource'
,
'https://example.com/path/*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path/to/resource'
,
'https://example.com/path/*/resource'
)
,
true
)
;
}
)
;
test
(
'subdomain wildcard matching'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://sub.example.com'
,
'https://*.example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://sub.domain.example.com'
,
'https://*.example.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://*.example.com'
)
,
true
)
;
}
)
;
test
(
'subdomain wildcard must match on dot boundary'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://notexample.com'
,
'https://*.example.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://evil-microsoft.com'
,
'https://*.microsoft.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://evilmicrosoft.com'
,
'https://*.microsoft.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://evil-example.com'
,
'https://*.example.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://myexample.com'
,
'https://*.example.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://notexample.com/path'
,
'https://*.example.com/path'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://sub.microsoft.com'
,
'https://*.microsoft.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://a.b.c.microsoft.com'
,
'https://*.microsoft.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://microsoft.com'
,
'https://*.microsoft.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://sub.example.com/path'
,
'https://*.example.com/path'
)
,
true
)
;
}
)
;
test
(
'subdomain wildcard without scheme must match on dot boundary'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://evil-microsoft.com'
,
'*.microsoft.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'http://evil-microsoft.com'
,
'*.microsoft.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://sub.microsoft.com'
,
'*.microsoft.com'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'http://sub.microsoft.com'
,
'*.microsoft.com'
)
,
true
)
;
}
)
;
test
(
'port matching'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com:8080'
,
'https://example.com:8080'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com:8080'
,
'https://example.com:9090'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com:8080'
)
,
false
)
;
}
)
;
test
(
'wildcard port matching'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com:8080'
,
'https://example.com:*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com:9090'
,
'https://example.com:*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com:*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com:8080/path'
,
'https://example.com:*/path'
)
,
true
)
;
}
)
;
test
(
'root path glob'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com/'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/'
,
'https://example.com/'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path'
,
'https://example.com/'
)
,
true
)
;
}
)
;
test
(
'mismatch cases'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com/path'
,
'https://example.com/other'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://other.com'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://sub.example.com'
,
'https://example.com'
)
,
false
)
;
}
)
;
test
(
'URI object input'
,
(
)
=>
{
const
=
URI
.
parse
(
'https://example.com/path'
)
;
.
strictEqual
(
testUrlMatchesGlob
(
,
'https://example.com/path'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
,
'https://example.com/*'
)
,
true
)
;
}
)
;
test
(
'complex patterns'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://api.github.com/repos/microsoft/vscode'
,
'https://*.github.com/repos/*/*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://github.com/microsoft/vscode'
,
'https://*.github.com/repos/*/*'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://api.github.com:443/repos/microsoft/vscode'
,
'https://*.github.com:*/repos/*/*'
)
,
true
)
;
}
)
;
test
(
'edge cases'
,
(
)
=>
{
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'https://example.com*'
)
,
false
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com.extra'
,
'https://example.com*'
)
,
true
)
;
.
strictEqual
(
testUrlMatchesGlob
(
'https://example.com'
,
'*'
)
,
true
)
;
}
)
;
}
)
;
}
)
;