Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/record.rs')
-rw-r--r--crates/ide-completion/src/tests/record.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/record.rs b/crates/ide-completion/src/tests/record.rs
index e64ec74c61..56162bb57b 100644
--- a/crates/ide-completion/src/tests/record.rs
+++ b/crates/ide-completion/src/tests/record.rs
@@ -2,6 +2,8 @@ use expect_test::{expect, Expect};
use crate::tests::completion_list;
+use super::check_edit;
+
fn check(ra_fixture: &str, expect: Expect) {
let actual = completion_list(ra_fixture);
expect.assert_eq(&actual);
@@ -301,3 +303,48 @@ fn foo() {
expect![[r#""#]],
)
}
+
+#[test]
+fn add_space_after_vis_kw() {
+ check_edit(
+ "pub(crate)",
+ r"
+pub(crate) struct S {
+ $0
+}
+",
+ r#"
+pub(crate) struct S {
+ pub(crate) $0
+}
+"#,
+ );
+
+ check_edit(
+ "pub",
+ r"
+pub struct S {
+ $0
+}
+",
+ r#"
+pub struct S {
+ pub $0
+}
+"#,
+ );
+
+ check_edit(
+ "pub(super)",
+ r"
+pub(super) struct S {
+ $0
+}
+",
+ r#"
+pub(super) struct S {
+ pub(super) $0
+}
+"#,
+ );
+}