diff options
Diffstat (limited to 'third_party/rust/libloading/tests/library_filename.rs')
-rw-r--r-- | third_party/rust/libloading/tests/library_filename.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/rust/libloading/tests/library_filename.rs b/third_party/rust/libloading/tests/library_filename.rs new file mode 100644 index 0000000000..efe51b8656 --- /dev/null +++ b/third_party/rust/libloading/tests/library_filename.rs @@ -0,0 +1,17 @@ +extern crate libloading; +use libloading::library_filename; +use std::path::Path; + +#[cfg(target_os = "windows")] +const EXPECTED: &str = "audioengine.dll"; +#[cfg(target_os = "linux")] +const EXPECTED: &str = "libaudioengine.so"; +#[cfg(target_os = "macos")] +const EXPECTED: &str = "libaudioengine.dylib"; + +#[test] +fn test_library_filename() { + let name = "audioengine"; + let resolved = library_filename(name); + assert!(Path::new(&resolved).ends_with(EXPECTED)); +} |