Remove test

This commit is contained in:
Piotr Osiewicz 2023-07-17 12:56:25 +02:00
parent 5b6582a7c2
commit ee9123a7da

View File

@ -134,64 +134,3 @@ async fn get_cached_server_binary(
.await
.log_err()
}
#[cfg(test)]
mod tests {
use gpui::TestAppContext;
use unindent::Unindent;
#[gpui::test]
async fn test_outline(cx: &mut TestAppContext) {
let language = crate::languages::language("php", tree_sitter_php::language(), None).await;
/*let text = r#"
function a() {
// local variables are omitted
let a1 = 1;
// all functions are included
async function a2() {}
}
// top-level variables are included
let b: C
function getB() {}
// exported variables are included
export const d = e;
"#
.unindent();*/
let text = r#"
function a() {
// local variables are omitted
$a1 = 1;
// all functions are included
function a2() {}
}
class Foo {}
"#
.unindent();
let buffer =
cx.add_model(|cx| language::Buffer::new(0, text, cx).with_language(language, cx));
let outline = buffer.read_with(cx, |buffer, _| buffer.snapshot().outline(None).unwrap());
panic!(
"{:?}",
outline
.items
.iter()
.map(|item| (item.text.as_str(), item.depth))
.collect::<Vec<_>>()
);
assert_eq!(
outline
.items
.iter()
.map(|item| (item.text.as_str(), item.depth))
.collect::<Vec<_>>(),
&[
("function a()", 0),
("async function a2()", 1),
("let b", 0),
("function getB()", 0),
("const d", 0),
]
);
}
}