.cargo/vendor/libloading/tests/library_filename.rs
raw| 1 | extern crate libloading; |
| 2 | use libloading::library_filename; |
| 3 | use std::path::Path; |
| 4 | |
| 5 | #[cfg(target_os = "windows")] |
| 6 | const EXPECTED: &str = "audioengine.dll"; |
| 7 | #[cfg(target_os = "linux")] |
| 8 | const EXPECTED: &str = "libaudioengine.so"; |
| 9 | #[cfg(target_os = "macos")] |
| 10 | const EXPECTED: &str = "libaudioengine.dylib"; |
| 11 | |
| 12 | #[test] |
| 13 | fn test_library_filename() { |
| 14 | let name = "audioengine"; |
| 15 | let resolved = library_filename(name); |
| 16 | assert!(Path::new(&resolved).ends_with(EXPECTED)); |
| 17 | } |