Skip to content

Commit 1b33870

Browse files
committed
remove some test
1 parent ca6fe6d commit 1b33870

File tree

2 files changed

+155
-155
lines changed

2 files changed

+155
-155
lines changed
Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
#[cfg(test)]
2-
mod tests {
3-
use crate::handlers::test_lib::{ProviderVirtualWorkspace, VirtualCodeAction, check};
4-
use googletest::prelude::*;
5-
use xmake_code_analysis::{DiagnosticCode, Emmyrc};
1+
// #[cfg(test)]
2+
// mod tests {
3+
// use crate::handlers::test_lib::{ProviderVirtualWorkspace, VirtualCodeAction, check};
4+
// use googletest::prelude::*;
5+
// use xmake_code_analysis::{DiagnosticCode, Emmyrc};
66

7-
#[gtest]
8-
fn test_1() -> Result<()> {
9-
let mut ws = ProviderVirtualWorkspace::new();
10-
ws.def(
11-
r#"
12-
---@class Cast1
13-
---@field get fun(self: self, a: number): Cast1?
14-
"#,
15-
);
7+
// #[gtest]
8+
// fn test_1() -> Result<()> {
9+
// let mut ws = ProviderVirtualWorkspace::new();
10+
// ws.def(
11+
// r#"
12+
// ---@class Cast1
13+
// ---@field get fun(self: self, a: number): Cast1?
14+
// "#,
15+
// );
1616

17-
check!(ws.check_code_action(
18-
r#"
19-
---@type Cast1
20-
local A
17+
// check!(ws.check_code_action(
18+
// r#"
19+
// ---@type Cast1
20+
// local A
2121

22-
local _a = A:get(1):get(2):get(3)
23-
"#,
24-
vec![
25-
VirtualCodeAction {
26-
title: "use cast to remove nil".to_string()
27-
},
28-
VirtualCodeAction {
29-
title: "Disable current line diagnostic (need-check-nil)".to_string()
30-
},
31-
VirtualCodeAction {
32-
title: "Disable all diagnostics in current file (need-check-nil)".to_string()
33-
},
34-
VirtualCodeAction {
35-
title:
36-
"Disable all diagnostics in current project (need-check-nil)".to_string()
37-
},
38-
VirtualCodeAction {
39-
title: "use cast to remove nil".to_string()
40-
},
41-
VirtualCodeAction {
42-
title: "Disable current line diagnostic (need-check-nil)".to_string()
43-
},
44-
VirtualCodeAction {
45-
title: "Disable all diagnostics in current file (need-check-nil)".to_string()
46-
},
47-
VirtualCodeAction {
48-
title:
49-
"Disable all diagnostics in current project (need-check-nil)".to_string()
50-
},
51-
]
52-
));
22+
// local _a = A:get(1):get(2):get(3)
23+
// "#,
24+
// vec![
25+
// VirtualCodeAction {
26+
// title: "use cast to remove nil".to_string()
27+
// },
28+
// VirtualCodeAction {
29+
// title: "Disable current line diagnostic (need-check-nil)".to_string()
30+
// },
31+
// VirtualCodeAction {
32+
// title: "Disable all diagnostics in current file (need-check-nil)".to_string()
33+
// },
34+
// VirtualCodeAction {
35+
// title:
36+
// "Disable all diagnostics in current project (need-check-nil)".to_string()
37+
// },
38+
// VirtualCodeAction {
39+
// title: "use cast to remove nil".to_string()
40+
// },
41+
// VirtualCodeAction {
42+
// title: "Disable current line diagnostic (need-check-nil)".to_string()
43+
// },
44+
// VirtualCodeAction {
45+
// title: "Disable all diagnostics in current file (need-check-nil)".to_string()
46+
// },
47+
// VirtualCodeAction {
48+
// title:
49+
// "Disable all diagnostics in current project (need-check-nil)".to_string()
50+
// },
51+
// ]
52+
// ));
5353

54-
Ok(())
55-
}
54+
// Ok(())
55+
// }
5656

57-
#[gtest]
58-
fn test_add_doc_tag() -> Result<()> {
59-
let mut ws = ProviderVirtualWorkspace::new();
60-
let mut emmyrc = Emmyrc::default();
61-
emmyrc
62-
.diagnostics
63-
.enables
64-
.push(DiagnosticCode::UnknownDocTag);
65-
ws.analysis.update_config(emmyrc.into());
66-
check!(ws.check_code_action(
67-
r#"
68-
---@class Cast1
69-
---@foo bar
70-
"#,
71-
vec![
72-
VirtualCodeAction {
73-
title: "Add @foo to the list of known tags".to_string()
74-
},
75-
VirtualCodeAction {
76-
title: "Disable current line diagnostic (unknown-doc-tag)".to_string()
77-
},
78-
VirtualCodeAction {
79-
title: "Disable all diagnostics in current file (unknown-doc-tag)".to_string()
80-
},
81-
VirtualCodeAction {
82-
title:
83-
"Disable all diagnostics in current project (unknown-doc-tag)".to_string()
84-
},
85-
]
86-
));
57+
// #[gtest]
58+
// fn test_add_doc_tag() -> Result<()> {
59+
// let mut ws = ProviderVirtualWorkspace::new();
60+
// let mut emmyrc = Emmyrc::default();
61+
// emmyrc
62+
// .diagnostics
63+
// .enables
64+
// .push(DiagnosticCode::UnknownDocTag);
65+
// ws.analysis.update_config(emmyrc.into());
66+
// check!(ws.check_code_action(
67+
// r#"
68+
// ---@class Cast1
69+
// ---@foo bar
70+
// "#,
71+
// vec![
72+
// VirtualCodeAction {
73+
// title: "Add @foo to the list of known tags".to_string()
74+
// },
75+
// VirtualCodeAction {
76+
// title: "Disable current line diagnostic (unknown-doc-tag)".to_string()
77+
// },
78+
// VirtualCodeAction {
79+
// title: "Disable all diagnostics in current file (unknown-doc-tag)".to_string()
80+
// },
81+
// VirtualCodeAction {
82+
// title:
83+
// "Disable all diagnostics in current project (unknown-doc-tag)".to_string()
84+
// },
85+
// ]
86+
// ));
8787

88-
Ok(())
89-
}
90-
}
88+
// Ok(())
89+
// }
90+
// }

crates/xmake_ls/src/handlers/test/completion_test.rs

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -882,77 +882,77 @@ mod tests {
882882
Ok(())
883883
}
884884

885-
#[gtest]
886-
fn test_auto_require() -> Result<()> {
887-
let mut ws = ProviderVirtualWorkspace::new();
888-
let mut emmyrc = ws.get_emmyrc();
889-
emmyrc.completion.auto_require_naming_convention = EmmyrcFilenameConvention::KeepClass;
890-
ws.update_emmyrc(emmyrc);
891-
ws.def_file(
892-
"map.lua",
893-
r#"
894-
---@class Map
895-
local Map = {}
896-
897-
return Map
898-
"#,
899-
);
900-
check!(ws.check_completion(
901-
r#"
902-
ma<??>
903-
"#,
904-
vec![VirtualCompletionItem {
905-
label: "Map".to_string(),
906-
kind: CompletionItemKind::MODULE,
907-
label_detail: Some(" (in map)".to_string()),
908-
}],
909-
));
910-
Ok(())
911-
}
912-
913-
#[gtest]
914-
fn test_auto_require_table_field() -> Result<()> {
915-
let mut ws = ProviderVirtualWorkspace::new();
916-
ws.def_file(
917-
"aaaa.lua",
918-
r#"
919-
---@export
920-
local export = {}
921-
922-
---@enum MapName
923-
export.MapName = {
924-
A = 1,
925-
B = 2,
926-
}
927-
928-
return export
929-
"#,
930-
);
931-
ws.def_file(
932-
"bbbb.lua",
933-
r#"
934-
local export = {}
935-
936-
---@enum PA
937-
export.PA = {
938-
A = 1,
939-
}
940-
941-
return export
942-
"#,
943-
);
944-
check!(ws.check_completion(
945-
r#"
946-
mapn<??>
947-
"#,
948-
vec![VirtualCompletionItem {
949-
label: "MapName".to_string(),
950-
kind: CompletionItemKind::CLASS,
951-
label_detail: Some(" (in aaaa)".to_string()),
952-
}],
953-
));
954-
Ok(())
955-
}
885+
// #[gtest]
886+
// fn test_auto_require() -> Result<()> {
887+
// let mut ws = ProviderVirtualWorkspace::new();
888+
// let mut emmyrc = ws.get_emmyrc();
889+
// emmyrc.completion.auto_require_naming_convention = EmmyrcFilenameConvention::KeepClass;
890+
// ws.update_emmyrc(emmyrc);
891+
// ws.def_file(
892+
// "map.lua",
893+
// r#"
894+
// ---@class Map
895+
// local Map = {}
896+
897+
// return Map
898+
// "#,
899+
// );
900+
// check!(ws.check_completion(
901+
// r#"
902+
// ma<??>
903+
// "#,
904+
// vec![VirtualCompletionItem {
905+
// label: "Map".to_string(),
906+
// kind: CompletionItemKind::MODULE,
907+
// label_detail: Some(" (in map)".to_string()),
908+
// }],
909+
// ));
910+
// Ok(())
911+
// }
912+
913+
// #[gtest]
914+
// fn test_auto_require_table_field() -> Result<()> {
915+
// let mut ws = ProviderVirtualWorkspace::new();
916+
// ws.def_file(
917+
// "aaaa.lua",
918+
// r#"
919+
// ---@export
920+
// local export = {}
921+
922+
// ---@enum MapName
923+
// export.MapName = {
924+
// A = 1,
925+
// B = 2,
926+
// }
927+
928+
// return export
929+
// "#,
930+
// );
931+
// ws.def_file(
932+
// "bbbb.lua",
933+
// r#"
934+
// local export = {}
935+
936+
// ---@enum PA
937+
// export.PA = {
938+
// A = 1,
939+
// }
940+
941+
// return export
942+
// "#,
943+
// );
944+
// check!(ws.check_completion(
945+
// r#"
946+
// mapn<??>
947+
// "#,
948+
// vec![VirtualCompletionItem {
949+
// label: "MapName".to_string(),
950+
// kind: CompletionItemKind::CLASS,
951+
// label_detail: Some(" (in aaaa)".to_string()),
952+
// }],
953+
// ));
954+
// Ok(())
955+
// }
956956

957957
#[gtest]
958958
fn test_field_is_alias_function() -> Result<()> {

0 commit comments

Comments
 (0)