mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
internal: move builtin macro tests to macro expansion suite
This commit is contained in:
parent
bfc5d8529a
commit
6a3fc84921
3 changed files with 122 additions and 76 deletions
|
@ -669,82 +669,6 @@ mod tests {
|
|||
expect.assert_eq(&expansion);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_column_expand() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! column {() => {}}
|
||||
column!()
|
||||
"#,
|
||||
expect![["0"]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_line_expand() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! line {() => {}}
|
||||
line!()
|
||||
"#,
|
||||
expect![["0"]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stringify_expand() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! stringify {() => {}}
|
||||
stringify!(
|
||||
a
|
||||
b
|
||||
c
|
||||
)
|
||||
"#,
|
||||
expect![["\"a b c\""]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_env_expand() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! env {() => {}}
|
||||
env!("TEST_ENV_VAR")
|
||||
"#,
|
||||
expect![["\"__RA_UNIMPLEMENTED__\""]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_option_env_expand() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! option_env {() => {}}
|
||||
option_env!("TEST_ENV_VAR")
|
||||
"#,
|
||||
expect![["std::option::Option::None:: < &str>"]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_file_expand() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! file {() => {}}
|
||||
file!()
|
||||
"#,
|
||||
expect![[r#""""#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_assert_expand() {
|
||||
check_expansion(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue