tests/event_property_parser: observe with MPV_CHANNEL_ID instead of literal
All checks were successful
Build and test / check (push) Successful in 55s
Build and test / build (push) Successful in 1m22s
Build and test / docs (push) Successful in 1m22s
Build and test / test (push) Successful in 2m27s

This commit is contained in:
2026-01-02 20:26:47 +09:00
parent deb55bf582
commit ca09fada68
2 changed files with 4 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ async fn test_highlevel_event_pause() -> Result<(), MpvError> {
async fn test_highlevel_event_volume() -> Result<(), MpvError> {
let (proc, mpv) = spawn_headless_mpv().await?;
mpv.observe_property(1337, "volume").await?;
mpv.observe_property(MPV_CHANNEL_ID, "volume").await?;
let (handle, cancellation_token) = create_interruptable_event_property_checking_thread(
mpv.clone(),
|property| match property {
@@ -73,7 +73,7 @@ async fn test_highlevel_event_volume() -> Result<(), MpvError> {
async fn test_highlevel_event_mute() -> Result<(), MpvError> {
let (proc, mpv) = spawn_headless_mpv().await?;
mpv.observe_property(1337, "mute").await?;
mpv.observe_property(MPV_CHANNEL_ID, "mute").await?;
let (handle, cancellation_token) = create_interruptable_event_property_checking_thread(
mpv.clone(),
|property| match property {
@@ -102,7 +102,7 @@ async fn test_highlevel_event_mute() -> Result<(), MpvError> {
async fn test_highlevel_event_duration() -> Result<(), MpvError> {
let (proc, mpv) = spawn_headless_mpv().await?;
mpv.observe_property(1337, "duration").await?;
mpv.observe_property(MPV_CHANNEL_ID, "duration").await?;
let (handle, cancellation_token) = create_interruptable_event_property_checking_thread(
mpv.clone(),

View File

@@ -45,6 +45,7 @@ pub async fn spawn_headless_mpv() -> Result<(Child, Mpv), MpvError> {
Ok((process_handle, mpv))
}
/// The channel ID used for property observation in tests
pub const MPV_CHANNEL_ID: u64 = 1337;
#[derive(Error, Debug)]