aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-03-10 14:01:08 +0000
committerEdwin Cheng <[email protected]>2020-03-10 17:06:01 +0000
commit5a292309c55639a12d10b3c37b9f800d8b802b6d (patch)
tree29de25283ac4cc391b2364969b3b9ead1d812993 /crates/ra_hir_ty/src
parente00a1e0b79e2b2c0c20a96e5341e3a35f46f99b7 (diff)
Add and fix tests
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r--crates/ra_hir_ty/src/tests/macros.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs
index ffa78b046..32457bbf7 100644
--- a/crates/ra_hir_ty/src/tests/macros.rs
+++ b/crates/ra_hir_ty/src/tests/macros.rs
@@ -550,6 +550,26 @@ fn main() {
550} 550}
551 551
552#[test] 552#[test]
553fn infer_builtin_macros_env() {
554 assert_snapshot!(
555 infer(r#"
556//- /main.rs env:foo=bar
557#[rustc_builtin_macro]
558macro_rules! env {() => {}}
559
560fn main() {
561 let x = env!("foo");
562}
563"#),
564 @r###"
565 ![0; 5) '"bar"': &str
566 [88; 116) '{ ...o"); }': ()
567 [98; 99) 'x': &str
568 "###
569 );
570}
571
572#[test]
553fn infer_derive_clone_simple() { 573fn infer_derive_clone_simple() {
554 let (db, pos) = TestDB::with_position( 574 let (db, pos) = TestDB::with_position(
555 r#" 575 r#"