use std::fs;
#[test]
fn plugin_initializer_is_exposed_for_desktop_runtimes() {
let initializer = tauri_plugin_audioplayer::init::<tauri::Wry>;
let _ = initializer;
}
#[test]
fn default_permissions_expose_every_frontend_command() {
let manifest_path = concat!(env!("CARGO_MANIFEST_DIR"), "/permissions/default.toml");
let manifest = fs::read_to_string(manifest_path).unwrap();
for permission in [
"allow-list-input-devices",
"allow-list-output-devices",
"allow-select-input-device",
"allow-select-output-device",
"allow-load-audio",
"allow-play-audio",
"allow-pause-audio",
"allow-stop-audio",
"allow-set-volume",
"allow-mute",
"allow-playback-progress",
"allow-seek-audio",
] {
assert!(
manifest.contains(permission),
"missing permission: {permission}"
);
}
}
#[test]
fn published_decoder_dependencies_stay_on_the_crates_io_compatible_versions() {
let manifest_path = concat!(env!("CARGO_MANIFEST_DIR"), "/Cargo.toml");
let manifest = fs::read_to_string(manifest_path).unwrap();
for dependency in [
"symphonia = { version = \"=0.5.4\", features = [\"all\"] }",
"symphonia-core = \"=0.5.5\"",
"symphonia-adapter-libopus = { version = \"=0.1.1\" }",
] {
assert!(
manifest.contains(dependency),
"missing crates.io-compatible decoder dependency: {dependency}"
);
}
assert!(
!manifest.contains("symphonia-adapter-libopus = { git ="),
"the published crate must not depend on a Git-only libopus adapter"
);
}