From f2b9a6a2f07649ebcf425c7b0db85b028221b997 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 15 Nov 2026 06:11:05 -0500 Subject: [PATCH] test(print): match shared CUPS IPP reply version --- crates/engine/src/cmd/print_cmds/tests/ipp_fixture.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/print_cmds/tests/ipp_fixture.rs b/crates/engine/src/cmd/print_cmds/tests/ipp_fixture.rs index dde323e318..5c8d62d565 100644 --- a/crates/engine/src/cmd/print_cmds/tests/ipp_fixture.rs +++ b/crates/engine/src/cmd/print_cmds/tests/ipp_fixture.rs @@ -21,7 +21,8 @@ pub struct Request { impl Request { pub fn new(op: u16, id: u32) -> Self { - let mut buf = vec![2, 0]; + // Shared CUPS requests and their replies use IPP 1.1. + let mut buf = vec![1, 1]; buf.extend_from_slice(&op.to_be_bytes()); buf.extend_from_slice(&id.to_be_bytes()); buf.push(TAG_OPERATION_GROUP); @@ -109,3 +110,9 @@ pub fn parse_request(bytes: &[u8]) -> Option<(u16, Vec, Vec)> { } } } + +#[test] +fn fake_reply_preserves_shared_ipp_version_and_request_id() { + let reply = Request::new(0, 0x12345678).end(); + assert_eq!(&reply[..8], &[1, 1, 0, 0, 0x12, 0x34, 0x56, 0x78]); +}