test(kitty): refuse every indirect medium on a remote pane, not just shm

`query_reply_refuses_shm_file_on_remote_pane` probed `t=d` and `t=s` and
stopped, while its local counterpart probes all three of `t=s`, `t=f` and
`t=t`. The refusing side is the one where a gap would matter: `t=f` and
`t=t` name a path on *this* machine, and on a remote pane the sender is
at the other end of an ssh link.

The behaviour was already right — `honored` is
`medium == Direct || honors_indirect_media()`, one classification for
every indirect medium, so file and tempfile were refused by the same
branch shm was. This is coverage catching up with the name, not a fix.

Confirmed it earns its place: honoring `Medium::File` on a remote pane
now fails the test naming the probe, where before it passed untouched.
The message spells the probe out the way the shm-name test does, so a
failure reads as a probe rather than 36 bytes.
This commit is contained in:
l0ng-ai
2026-08-16 03:09:20 +08:00
parent 23b7b2dd2f
commit f6a85ba5ca
+23 -7
View File
@@ -1570,14 +1570,30 @@ mod tests {
}
_ => panic!("expected query"),
}
// The shm/file medium probes must be refused so the sender falls back.
let ev = p.feed(b"Gi=299,a=q,t=s,f=32,s=1,v=1;L3B4LXE").unwrap();
match ev {
Event::Query { reply, honored } => {
assert!(!honored);
assert_eq!(reply, b"\x1b_Gi=299;ENOTSUPPORTED\x1b\\".to_vec());
// Every indirect medium, not just shm: `t=f` and `t=t` name a path on
// *this* machine, and the sender is on the other end of an ssh link.
// The local counterpart probes all three, and the refusing side is the
// one where a gap would matter.
for (id, probe) in [
(299, &b"Gi=299,a=q,t=s,f=32,s=1,v=1;L3B4LXE"[..]),
(300, &b"Gi=300,a=q,t=f,f=32,s=1,v=1;L3RtcC94"[..]),
(301, &b"Gi=301,a=q,t=t,f=32,s=1,v=1;L3RtcC94"[..]),
] {
let ev = p.feed(probe).unwrap();
match ev {
Event::Query { reply, honored } => {
assert!(
!honored,
"remote pane honored {}",
String::from_utf8_lossy(probe)
);
assert_eq!(
reply,
format!("\x1b_Gi={id};ENOTSUPPORTED\x1b\\").into_bytes()
);
}
_ => panic!("expected query"),
}
_ => panic!("expected query"),
}
}