Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7a89df95
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7a89df95
编写于
1月 25, 2021
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
some more strict asserting tests
上级
3cb3624b
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
392 addition
and
392 deletion
+392
-392
src/vs/base/test/common/markdownString.test.ts
src/vs/base/test/common/markdownString.test.ts
+9
-9
src/vs/base/test/common/resources.test.ts
src/vs/base/test/common/resources.test.ts
+129
-129
src/vs/base/test/common/skipList.test.ts
src/vs/base/test/common/skipList.test.ts
+21
-21
src/vs/base/test/common/uri.test.ts
src/vs/base/test/common/uri.test.ts
+231
-231
src/vs/base/test/common/uuid.test.ts
src/vs/base/test/common/uuid.test.ts
+2
-2
未找到文件。
src/vs/base/test/common/markdownString.test.ts
浏览文件 @
7a89df95
...
@@ -11,13 +11,13 @@ suite('MarkdownString', () => {
...
@@ -11,13 +11,13 @@ suite('MarkdownString', () => {
test
(
'
Escape leading whitespace
'
,
function
()
{
test
(
'
Escape leading whitespace
'
,
function
()
{
const
mds
=
new
MarkdownString
();
const
mds
=
new
MarkdownString
();
mds
.
appendText
(
'
Hello
\n
Not a code block
'
);
mds
.
appendText
(
'
Hello
\n
Not a code block
'
);
assert
.
e
qual
(
mds
.
value
,
'
Hello
\n\n
Not a code block
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
Hello
\n\n
Not a code block
'
);
});
});
test
(
'
MarkdownString.appendText doesn
\'
t escape quote #109040
'
,
function
()
{
test
(
'
MarkdownString.appendText doesn
\'
t escape quote #109040
'
,
function
()
{
const
mds
=
new
MarkdownString
();
const
mds
=
new
MarkdownString
();
mds
.
appendText
(
'
> Text
\n
>More
'
);
mds
.
appendText
(
'
> Text
\n
>More
'
);
assert
.
e
qual
(
mds
.
value
,
'
\\
> Text
\n\n\\
>More
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
\\
> Text
\n\n\\
>More
'
);
});
});
test
(
'
appendText
'
,
()
=>
{
test
(
'
appendText
'
,
()
=>
{
...
@@ -25,7 +25,7 @@ suite('MarkdownString', () => {
...
@@ -25,7 +25,7 @@ suite('MarkdownString', () => {
const
mds
=
new
MarkdownString
();
const
mds
=
new
MarkdownString
();
mds
.
appendText
(
'
# foo
\n
*bar*
'
);
mds
.
appendText
(
'
# foo
\n
*bar*
'
);
assert
.
e
qual
(
mds
.
value
,
'
\\
# foo
\n\n\\
*bar
\\
*
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
\\
# foo
\n\n\\
*bar
\\
*
'
);
});
});
suite
(
'
ThemeIcons
'
,
()
=>
{
suite
(
'
ThemeIcons
'
,
()
=>
{
...
@@ -36,21 +36,21 @@ suite('MarkdownString', () => {
...
@@ -36,21 +36,21 @@ suite('MarkdownString', () => {
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
mds
.
appendText
(
'
$(zap) $(not a theme icon) $(add)
'
);
mds
.
appendText
(
'
$(zap) $(not a theme icon) $(add)
'
);
assert
.
e
qual
(
mds
.
value
,
'
\\\\
$
\\
(zap
\\
) $
\\
(not a theme icon
\\
)
\\\\
$
\\
(add
\\
)
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
\\\\
$
\\
(zap
\\
) $
\\
(not a theme icon
\\
)
\\\\
$
\\
(add
\\
)
'
);
});
});
test
(
'
appendMarkdown
'
,
()
=>
{
test
(
'
appendMarkdown
'
,
()
=>
{
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
mds
.
appendMarkdown
(
'
$(zap) $(not a theme icon) $(add)
'
);
mds
.
appendMarkdown
(
'
$(zap) $(not a theme icon) $(add)
'
);
assert
.
e
qual
(
mds
.
value
,
'
$(zap) $(not a theme icon) $(add)
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
$(zap) $(not a theme icon) $(add)
'
);
});
});
test
(
'
appendMarkdown with escaped icon
'
,
()
=>
{
test
(
'
appendMarkdown with escaped icon
'
,
()
=>
{
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
mds
.
appendMarkdown
(
'
\\
$(zap) $(not a theme icon) $(add)
'
);
mds
.
appendMarkdown
(
'
\\
$(zap) $(not a theme icon) $(add)
'
);
assert
.
e
qual
(
mds
.
value
,
'
\\
$(zap) $(not a theme icon) $(add)
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
\\
$(zap) $(not a theme icon) $(add)
'
);
});
});
});
});
...
@@ -61,21 +61,21 @@ suite('MarkdownString', () => {
...
@@ -61,21 +61,21 @@ suite('MarkdownString', () => {
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
false
});
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
false
});
mds
.
appendText
(
'
$(zap) $(not a theme icon) $(add)
'
);
mds
.
appendText
(
'
$(zap) $(not a theme icon) $(add)
'
);
assert
.
e
qual
(
mds
.
value
,
'
$
\\
(zap
\\
) $
\\
(not a theme icon
\\
) $
\\
(add
\\
)
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
$
\\
(zap
\\
) $
\\
(not a theme icon
\\
) $
\\
(add
\\
)
'
);
});
});
test
(
'
appendMarkdown
'
,
()
=>
{
test
(
'
appendMarkdown
'
,
()
=>
{
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
false
});
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
false
});
mds
.
appendMarkdown
(
'
$(zap) $(not a theme icon) $(add)
'
);
mds
.
appendMarkdown
(
'
$(zap) $(not a theme icon) $(add)
'
);
assert
.
e
qual
(
mds
.
value
,
'
$(zap) $(not a theme icon) $(add)
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
$(zap) $(not a theme icon) $(add)
'
);
});
});
test
(
'
appendMarkdown with escaped icon
'
,
()
=>
{
test
(
'
appendMarkdown with escaped icon
'
,
()
=>
{
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
const
mds
=
new
MarkdownString
(
undefined
,
{
supportThemeIcons
:
true
});
mds
.
appendMarkdown
(
'
\\
$(zap) $(not a theme icon) $(add)
'
);
mds
.
appendMarkdown
(
'
\\
$(zap) $(not a theme icon) $(add)
'
);
assert
.
e
qual
(
mds
.
value
,
'
\\
$(zap) $(not a theme icon) $(add)
'
);
assert
.
strictE
qual
(
mds
.
value
,
'
\\
$(zap) $(not a theme icon) $(add)
'
);
});
});
});
});
...
...
src/vs/base/test/common/resources.test.ts
浏览文件 @
7a89df95
此差异已折叠。
点击以展开。
src/vs/base/test/common/skipList.test.ts
浏览文件 @
7a89df95
...
@@ -12,45 +12,45 @@ import { binarySearch } from 'vs/base/common/arrays';
...
@@ -12,45 +12,45 @@ import { binarySearch } from 'vs/base/common/arrays';
suite
(
'
SkipList
'
,
function
()
{
suite
(
'
SkipList
'
,
function
()
{
function
assertValues
<
V
>
(
list
:
SkipList
<
any
,
V
>
,
expected
:
V
[])
{
function
assertValues
<
V
>
(
list
:
SkipList
<
any
,
V
>
,
expected
:
V
[])
{
assert
.
e
qual
(
list
.
size
,
expected
.
length
);
assert
.
strictE
qual
(
list
.
size
,
expected
.
length
);
assert
.
deepEqual
([...
list
.
values
()],
expected
);
assert
.
deep
Strict
Equal
([...
list
.
values
()],
expected
);
let
valuesFromEntries
=
[...
list
.
entries
()].
map
(
entry
=>
entry
[
1
]);
let
valuesFromEntries
=
[...
list
.
entries
()].
map
(
entry
=>
entry
[
1
]);
assert
.
deepEqual
(
valuesFromEntries
,
expected
);
assert
.
deep
Strict
Equal
(
valuesFromEntries
,
expected
);
let
valuesFromIter
=
[...
list
].
map
(
entry
=>
entry
[
1
]);
let
valuesFromIter
=
[...
list
].
map
(
entry
=>
entry
[
1
]);
assert
.
deepEqual
(
valuesFromIter
,
expected
);
assert
.
deep
Strict
Equal
(
valuesFromIter
,
expected
);
let
i
=
0
;
let
i
=
0
;
list
.
forEach
((
value
,
_key
,
map
)
=>
{
list
.
forEach
((
value
,
_key
,
map
)
=>
{
assert
.
ok
(
map
===
list
);
assert
.
ok
(
map
===
list
);
assert
.
deepEqual
(
value
,
expected
[
i
++
]);
assert
.
deep
Strict
Equal
(
value
,
expected
[
i
++
]);
});
});
}
}
function
assertKeys
<
K
>
(
list
:
SkipList
<
K
,
any
>
,
expected
:
K
[])
{
function
assertKeys
<
K
>
(
list
:
SkipList
<
K
,
any
>
,
expected
:
K
[])
{
assert
.
e
qual
(
list
.
size
,
expected
.
length
);
assert
.
strictE
qual
(
list
.
size
,
expected
.
length
);
assert
.
deepEqual
([...
list
.
keys
()],
expected
);
assert
.
deep
Strict
Equal
([...
list
.
keys
()],
expected
);
let
keysFromEntries
=
[...
list
.
entries
()].
map
(
entry
=>
entry
[
0
]);
let
keysFromEntries
=
[...
list
.
entries
()].
map
(
entry
=>
entry
[
0
]);
assert
.
deepEqual
(
keysFromEntries
,
expected
);
assert
.
deep
Strict
Equal
(
keysFromEntries
,
expected
);
let
keysFromIter
=
[...
list
].
map
(
entry
=>
entry
[
0
]);
let
keysFromIter
=
[...
list
].
map
(
entry
=>
entry
[
0
]);
assert
.
deepEqual
(
keysFromIter
,
expected
);
assert
.
deep
Strict
Equal
(
keysFromIter
,
expected
);
let
i
=
0
;
let
i
=
0
;
list
.
forEach
((
_value
,
key
,
map
)
=>
{
list
.
forEach
((
_value
,
key
,
map
)
=>
{
assert
.
ok
(
map
===
list
);
assert
.
ok
(
map
===
list
);
assert
.
deepEqual
(
key
,
expected
[
i
++
]);
assert
.
deep
Strict
Equal
(
key
,
expected
[
i
++
]);
});
});
}
}
test
(
'
set/get/delete
'
,
function
()
{
test
(
'
set/get/delete
'
,
function
()
{
let
list
=
new
SkipList
<
number
,
number
>
((
a
,
b
)
=>
a
-
b
);
let
list
=
new
SkipList
<
number
,
number
>
((
a
,
b
)
=>
a
-
b
);
assert
.
e
qual
(
list
.
get
(
3
),
undefined
);
assert
.
strictE
qual
(
list
.
get
(
3
),
undefined
);
list
.
set
(
3
,
1
);
list
.
set
(
3
,
1
);
assert
.
e
qual
(
list
.
get
(
3
),
1
);
assert
.
strictE
qual
(
list
.
get
(
3
),
1
);
assertValues
(
list
,
[
1
]);
assertValues
(
list
,
[
1
]);
list
.
set
(
3
,
3
);
list
.
set
(
3
,
3
);
...
@@ -58,17 +58,17 @@ suite('SkipList', function () {
...
@@ -58,17 +58,17 @@ suite('SkipList', function () {
list
.
set
(
1
,
1
);
list
.
set
(
1
,
1
);
list
.
set
(
4
,
4
);
list
.
set
(
4
,
4
);
assert
.
e
qual
(
list
.
get
(
3
),
3
);
assert
.
strictE
qual
(
list
.
get
(
3
),
3
);
assert
.
e
qual
(
list
.
get
(
1
),
1
);
assert
.
strictE
qual
(
list
.
get
(
1
),
1
);
assert
.
e
qual
(
list
.
get
(
4
),
4
);
assert
.
strictE
qual
(
list
.
get
(
4
),
4
);
assertValues
(
list
,
[
1
,
3
,
4
]);
assertValues
(
list
,
[
1
,
3
,
4
]);
assert
.
e
qual
(
list
.
delete
(
17
),
false
);
assert
.
strictE
qual
(
list
.
delete
(
17
),
false
);
assert
.
e
qual
(
list
.
delete
(
1
),
true
);
assert
.
strictE
qual
(
list
.
delete
(
1
),
true
);
assert
.
e
qual
(
list
.
get
(
1
),
undefined
);
assert
.
strictE
qual
(
list
.
get
(
1
),
undefined
);
assert
.
e
qual
(
list
.
get
(
3
),
3
);
assert
.
strictE
qual
(
list
.
get
(
3
),
3
);
assert
.
e
qual
(
list
.
get
(
4
),
4
);
assert
.
strictE
qual
(
list
.
get
(
4
),
4
);
assertValues
(
list
,
[
3
,
4
]);
assertValues
(
list
,
[
3
,
4
]);
});
});
...
@@ -87,7 +87,7 @@ suite('SkipList', function () {
...
@@ -87,7 +87,7 @@ suite('SkipList', function () {
assertKeys
(
list
,
[
3
,
6
,
7
,
9
,
12
,
19
,
21
,
25
]);
assertKeys
(
list
,
[
3
,
6
,
7
,
9
,
12
,
19
,
21
,
25
]);
list
.
set
(
17
,
true
);
list
.
set
(
17
,
true
);
assert
.
deepEqual
(
list
.
size
,
9
);
assert
.
deep
Strict
Equal
(
list
.
size
,
9
);
assertKeys
(
list
,
[
3
,
6
,
7
,
9
,
12
,
17
,
19
,
21
,
25
]);
assertKeys
(
list
,
[
3
,
6
,
7
,
9
,
12
,
17
,
19
,
21
,
25
]);
});
});
...
...
src/vs/base/test/common/uri.test.ts
浏览文件 @
7a89df95
此差异已折叠。
点击以展开。
src/vs/base/test/common/uuid.test.ts
浏览文件 @
7a89df95
...
@@ -8,8 +8,8 @@ import * as uuid from 'vs/base/common/uuid';
...
@@ -8,8 +8,8 @@ import * as uuid from 'vs/base/common/uuid';
suite
(
'
UUID
'
,
()
=>
{
suite
(
'
UUID
'
,
()
=>
{
test
(
'
generation
'
,
()
=>
{
test
(
'
generation
'
,
()
=>
{
const
asHex
=
uuid
.
generateUuid
();
const
asHex
=
uuid
.
generateUuid
();
assert
.
e
qual
(
asHex
.
length
,
36
);
assert
.
strictE
qual
(
asHex
.
length
,
36
);
assert
.
e
qual
(
asHex
[
14
],
'
4
'
);
assert
.
strictE
qual
(
asHex
[
14
],
'
4
'
);
assert
.
ok
(
asHex
[
19
]
===
'
8
'
||
asHex
[
19
]
===
'
9
'
||
asHex
[
19
]
===
'
a
'
||
asHex
[
19
]
===
'
b
'
);
assert
.
ok
(
asHex
[
19
]
===
'
8
'
||
asHex
[
19
]
===
'
9
'
||
asHex
[
19
]
===
'
a
'
||
asHex
[
19
]
===
'
b
'
);
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录