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