]> git.lizzy.rs Git - rust.git/blob - src/librustc_metadata/dynamic_lib/tests.rs
Remove support for self-opening
[rust.git] / src / librustc_metadata / dynamic_lib / tests.rs
1 use super::*;
2
3 #[test]
4 fn test_errors_do_not_crash() {
5     use std::path::Path;
6
7     if !cfg!(unix) {
8         return;
9     }
10
11     // Open /dev/null as a library to get an error, and make sure
12     // that only causes an error, and not a crash.
13     let path = Path::new("/dev/null");
14     match DynamicLibrary::open(&path) {
15         Err(_) => {}
16         Ok(_) => panic!("Successfully opened the empty library."),
17     }
18 }