Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
bccfce1b
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
bccfce1b
编写于
9月 21, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix tests
上级
4e172252
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
38 deletion
+29
-38
src/vs/workbench/parts/markers/test/common/markersModel.test.ts
.../workbench/parts/markers/test/common/markersModel.test.ts
+29
-38
未找到文件。
src/vs/workbench/parts/markers/test/common/markersModel.test.ts
浏览文件 @
bccfce1b
...
...
@@ -8,7 +8,7 @@
import
assert
=
require
(
'
assert
'
);
import
URI
from
'
vs/base/common/uri
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IMarker
,
MarkerStatistics
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IMarker
}
from
'
vs/platform/markers/common/markers
'
;
import
{
MarkersModel
,
Marker
,
Resource
}
from
'
vs/workbench/parts/markers/common/markersModel
'
;
suite
(
'
MarkersModel Test
'
,
()
=>
{
...
...
@@ -45,45 +45,45 @@ suite('MarkersModel Test', () => {
assert
.
ok
(
hasMarker
(
actuals
[
3
].
markers
,
marker5
));
});
test
(
'
getFilteredResource return markers grouped by resource sorted by file path
'
,
function
()
{
let
marker1
=
aMarker
(
'
a/res1
'
);
test
(
'
sort palces resources with no errors at the end
'
,
function
()
{
let
marker1
=
aMarker
(
'
a/res1
'
,
Severity
.
Warning
);
let
marker2
=
aMarker
(
'
a/res2
'
);
let
marker3
=
aMarker
(
'
res4
'
);
let
marker4
=
aMarker
(
'
b/res3
'
);
let
marker5
=
aMarker
(
'
res4
'
);
let
marker6
=
aMarker
(
'
c/res2
'
);
let
marker6
=
aMarker
(
'
c/res2
'
,
Severity
.
Info
);
let
testObject
=
new
MarkersModel
([
marker1
,
marker2
,
marker3
,
marker4
,
marker5
,
marker6
]);
let
actuals
=
testObject
.
filteredResources
;
let
actuals
=
testObject
.
filteredResources
.
sort
(
MarkersModel
.
compare
)
;
assert
.
equal
(
5
,
actuals
.
length
);
assert
.
ok
(
compareResource
(
actuals
[
0
],
'
a/res
1
'
));
assert
.
ok
(
compareResource
(
actuals
[
1
],
'
a/res2
'
));
assert
.
ok
(
compareResource
(
actuals
[
2
],
'
b/res3
'
));
assert
.
ok
(
compareResource
(
actuals
[
3
],
'
c/res2
'
));
assert
.
ok
(
compareResource
(
actuals
[
4
],
'
res4
'
));
assert
.
ok
(
compareResource
(
actuals
[
0
],
'
a/res
2
'
));
assert
.
ok
(
compareResource
(
actuals
[
1
],
'
b/res3
'
));
assert
.
ok
(
compareResource
(
actuals
[
2
],
'
res4
'
));
assert
.
ok
(
compareResource
(
actuals
[
3
],
'
a/res1
'
));
assert
.
ok
(
compareResource
(
actuals
[
4
],
'
c/res2
'
));
});
test
(
'
getFilteredResource return resources with no errors at the end
'
,
function
()
{
let
marker1
=
aMarker
(
'
a/res1
'
,
Severity
.
Warning
);
test
(
'
sort resources by file path
'
,
function
()
{
let
marker1
=
aMarker
(
'
a/res1
'
);
let
marker2
=
aMarker
(
'
a/res2
'
);
let
marker3
=
aMarker
(
'
res4
'
);
let
marker4
=
aMarker
(
'
b/res3
'
);
let
marker5
=
aMarker
(
'
res4
'
);
let
marker6
=
aMarker
(
'
c/res2
'
,
Severity
.
Info
);
let
marker6
=
aMarker
(
'
c/res2
'
);
let
testObject
=
new
MarkersModel
([
marker1
,
marker2
,
marker3
,
marker4
,
marker5
,
marker6
]);
let
actuals
=
testObject
.
filteredResources
;
let
actuals
=
testObject
.
filteredResources
.
sort
(
MarkersModel
.
compare
)
;
assert
.
equal
(
5
,
actuals
.
length
);
assert
.
ok
(
compareResource
(
actuals
[
0
],
'
a/res
2
'
));
assert
.
ok
(
compareResource
(
actuals
[
1
],
'
b/res3
'
));
assert
.
ok
(
compareResource
(
actuals
[
2
],
'
res4
'
));
assert
.
ok
(
compareResource
(
actuals
[
3
],
'
a/res1
'
));
assert
.
ok
(
compareResource
(
actuals
[
4
],
'
c/res2
'
));
assert
.
ok
(
compareResource
(
actuals
[
0
],
'
a/res
1
'
));
assert
.
ok
(
compareResource
(
actuals
[
1
],
'
a/res2
'
));
assert
.
ok
(
compareResource
(
actuals
[
2
],
'
b/res3
'
));
assert
.
ok
(
compareResource
(
actuals
[
3
],
'
c/res2
'
));
assert
.
ok
(
compareResource
(
actuals
[
4
],
'
res4
'
));
});
test
(
'
getFilteredResource return markers sorted
by line and column
'
,
function
()
{
test
(
'
sort markers
by line and column
'
,
function
()
{
let
marker1
=
aMarkerWithRange
(
8
,
1
,
9
,
3
);
let
marker2
=
aMarkerWithRange
(
3
);
let
marker3
=
aMarkerWithRange
(
5
);
...
...
@@ -94,27 +94,18 @@ suite('MarkersModel Test', () => {
let
marker8
=
aMarkerWithRange
(
8
,
2
,
8
,
4
);
let
testObject
=
new
MarkersModel
([
marker1
,
marker2
,
marker3
,
marker4
,
marker5
,
marker6
,
marker7
,
marker8
]);
let
actuals
=
testObject
.
filteredResources
;
assert
.
equal
(
8
,
actuals
[
0
].
markers
.
length
);
assert
.
equal
(
actuals
[
0
].
markers
[
0
].
marker
,
marker2
);
assert
.
equal
(
actuals
[
0
].
markers
[
1
].
marker
,
marker7
);
assert
.
equal
(
actuals
[
0
].
markers
[
2
].
marker
,
marker3
);
let
actuals
=
testObject
.
filteredResources
[
0
].
markers
.
sort
(
MarkersModel
.
compare
);
assert
.
equal
(
actuals
[
0
].
markers
[
3
].
marker
,
marker4
);
assert
.
equal
(
actuals
[
0
].
markers
[
4
].
marker
,
marker6
);
assert
.
equal
(
actuals
[
0
].
markers
[
5
].
marker
,
marker1
);
assert
.
equal
(
actuals
[
0
].
markers
[
6
].
marker
,
marker8
);
assert
.
equal
(
actuals
[
0
].
markers
[
7
].
marker
,
marker5
);
assert
.
equal
(
actuals
[
0
].
marker
,
marker2
);
assert
.
equal
(
actuals
[
1
].
marker
,
marker7
);
assert
.
equal
(
actuals
[
2
].
marker
,
marker3
);
assert
.
equal
(
actuals
[
3
].
marker
,
marker4
);
assert
.
equal
(
actuals
[
4
].
marker
,
marker6
);
assert
.
equal
(
actuals
[
5
].
marker
,
marker1
);
assert
.
equal
(
actuals
[
6
].
marker
,
marker8
);
assert
.
equal
(
actuals
[
7
].
marker
,
marker5
);
});
function
hasResource
(
resources
:
Resource
[],
resource
:
string
):
boolean
{
return
resources
.
filter
((
r
):
boolean
=>
{
return
r
.
uri
.
toString
()
===
URI
.
file
(
resource
).
toString
();
}).
length
===
1
;
}
function
hasMarker
(
markers
:
Marker
[],
marker
:
IMarker
):
boolean
{
return
markers
.
filter
((
m
):
boolean
=>
{
return
m
.
marker
===
marker
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录