From 5a292309c55639a12d10b3c37b9f800d8b802b6d Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 10 Mar 2020 22:01:08 +0800 Subject: Add and fix tests --- crates/ra_hir_ty/src/tests/macros.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crates/ra_hir_ty/src/tests/macros.rs') 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 @@ -549,6 +549,26 @@ fn main() { ); } +#[test] +fn infer_builtin_macros_env() { + assert_snapshot!( + infer(r#" +//- /main.rs env:foo=bar +#[rustc_builtin_macro] +macro_rules! env {() => {}} + +fn main() { + let x = env!("foo"); +} +"#), + @r###" + ![0; 5) '"bar"': &str + [88; 116) '{ ...o"); }': () + [98; 99) 'x': &str + "### + ); +} + #[test] fn infer_derive_clone_simple() { let (db, pos) = TestDB::with_position( -- cgit v1.2.3