Skip to content

Commit

Permalink
Avoid breaking words in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalica committed Aug 6, 2023
1 parent 565472e commit 5b55d6f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions crates/ide/src/def/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,20 +775,20 @@ mod tests {
#[test]
fn string() {
check_lower(
r#"" fo\no ""#,
r#"" a\nb ""#,
expect![[r#"
0: Literal(String(" fo\no "))
0: Literal(String(" a\nb "))
"#]],
);
check_lower(
r#"'' fo'''o ''"#,
r#"'' a'''b ''"#,
expect![[r#"
0: StringInterpolation([])
"#]],
);

check_lower(
r#"" fo${1}o\n$${${42}\💗""#,
r#"" a${1}b\n$${${42}\💗""#,
expect![[r#"
0: Literal(Int(1))
1: Literal(Int(42))
Expand Down
8 changes: 4 additions & 4 deletions crates/ide/src/ide/assists/add_to_top_level_lambda_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ mod tests {
check("{foo, ...}: $0bar", expect!["{foo, bar, ...}: bar"]);
check("{foo,...}: $0bar", expect!["{foo, bar,...}: bar"]);

check_no("{ foo }: fo$0o");
check_no("{ foo }: foo$0");
check_no("{ }: foo.$0bar");
check_no("{ }: let foo = bar; in f$0oo");
check_no("{ bar }: { fo$0o = bar; }");
check_no("bar: fo$0o");
check_no("{ }: let foo = bar; in $0foo");
check_no("{ bar }: { foo$0 = bar; }");
check_no("bar: foo$0");
}
}
4 changes: 2 additions & 2 deletions crates/ide/src/ide/assists/convert_to_inherit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ mod tests {
check("{ f$0oo = foo; }", expect!["{ inherit foo; }"]);
check("{ foo $0= foo; }", expect!["{ inherit foo; }"]);
check("{ foo = f$0oo; }", expect!["{ inherit foo; }"]);
check("{ fo$0o = fo$1o; }", expect!["{ inherit foo; }"]);
check("{ foo$0 = $1foo; }", expect!["{ inherit foo; }"]);

check_no("$0{ foo = foo; }");
}
Expand All @@ -120,7 +120,7 @@ mod tests {
fn multiple_rhs_plain() {
check("{ foo = bar.foo$0; }", expect!["{ inherit (bar) foo; }"]);
check(
"{ foo.bar = ba$0z.bar; }",
"{ foo.bar = baz$0.bar; }",
expect!["{ foo = { inherit (baz) bar; }; }"],
);
check(
Expand Down
2 changes: 1 addition & 1 deletion crates/ide/src/ide/assists/rewrite_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ mod tests {
);

check_no(r#"$0"foo""#);
check_no(r#"{ ${fo$0o} = bar; }"#);
check_no(r#"{ ${foo$0} = bar; }"#);
check_no(r#"{ $0"foo\n" = bar; }"#);
check_no(r#"{ "foo.$0bar" = baz; }"#);
}
Expand Down

0 comments on commit 5b55d6f

Please sign in to comment.