2023-04-14 19:00:15 +04:00
|
|
|
use super::*;
|
|
|
|
|
|
|
|
#[tokio::test(flavor = "multi_thread")]
|
|
|
|
async fn auto_indent() -> anyhow::Result<()> {
|
|
|
|
let app = || AppBuilder::new().with_file("foo.go", None);
|
|
|
|
|
|
|
|
let enter_tests = [
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
type Test struct {#[}|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"i<ret>",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
type Test struct {
|
|
|
|
\t#[|\n]#
|
|
|
|
}
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
func main() {
|
|
|
|
\tswitch nil {#[}|]#
|
|
|
|
}
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"i<ret>",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
func main() {
|
|
|
|
\tswitch nil {
|
|
|
|
\t\t#[|\n]#
|
|
|
|
\t}
|
|
|
|
}
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|
for test in enter_tests {
|
|
|
|
test_with_config(app(), test).await?;
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|