Add shadow import failing test.
This commit is contained in:
parent
4c68d0dc28
commit
f614d00575
@ -194,7 +194,29 @@ mod tests {
|
|||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
let mut symbol_table = SymbolTable::new();
|
let mut symbol_table = SymbolTable::new();
|
||||||
add_std_core_symbols(&mut symbol_table).expect("Failed to add std::core symbols.");
|
|
||||||
assert_no_diagnostics(sources, &mut symbol_table);
|
assert_no_diagnostics(sources, &mut symbol_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn shadow_import() {
|
||||||
|
let sources: HashMap<&str, &str> = HashMap::from([
|
||||||
|
(
|
||||||
|
"main.dm",
|
||||||
|
indoc! {"
|
||||||
|
use greeter::Greeter;
|
||||||
|
|
||||||
|
class Greeter {}
|
||||||
|
"}
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"greeter.dm",
|
||||||
|
indoc! {"
|
||||||
|
ns greeter;
|
||||||
|
|
||||||
|
class Greeter {}
|
||||||
|
"}
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
assert_number_of_diagnostics(sources, &mut SymbolTable::new(), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user