{"record":{"id":"1f1023d938a5775a","repo":"Hmbown/CodeWhale","slug":"expected-text-got-other","errorCode":null,"errorMessage":"expected text, got {other:?}","messagePattern":"expected text, got (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/image_attach/tests.rs","lineNumber":487,"sourceCode":"#[test]\nfn text_with_no_attachments_produces_nothing() {\n    let expanded = expand_attachment_blocks(\"just a normal question\");\n    assert!(expanded.blocks.is_empty());\n    assert!(expanded.notices.is_empty());\n}\n\n#[test]\nfn notice_block_names_the_failure_and_forbids_guessing() {\n    assert_eq!(notice_block(&[]), None);\n    let block =\n        notice_block(&[\"Cannot attach a.png: the file is empty\".to_string()]).expect(\"block\");\n    match block {\n        ContentBlock::Text { text, .. } => {\n            assert!(text.contains(\"<attachment_notice>\"), \"{text}\");\n            assert!(text.contains(\"a.png\"), \"{text}\");\n            assert!(text.contains(\"Do not describe\"), \"{text}\");\n        }\n        other => panic!(\"expected text, got {other:?}\"),\n    }\n}\n\n#[test]\nfn attach_from_path_reports_an_unreadable_file() {\n    let error = attach_image_from_path(Path::new(\"/nonexistent/x.png\")).expect_err(\"must fail\");\n    assert!(\n        matches!(error, ImageAttachError::Unreadable { .. }),\n        \"got {error:?}\"\n    );\n}\n\npub(crate) fn runtime_image_fixture(color: u8) -> codewhale_protocol::runtime::RuntimeImageInput {\n    let image = image::DynamicImage::ImageRgba8(image::RgbaImage::from_pixel(\n        2,\n        2,\n        image::Rgba([color, 31, 99, 255]),\n    ));","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/image_attach/tests.rs#L469-L505","documentation":"Test-only panic in notice_block_names_the_failure_and_forbids_guessing: notice_block returned a block that was not the expected ContentBlock::Text attachment notice, so the failure-notice formatting changed shape or returned an image/other variant.","triggerScenarios":"Thrown at crates/tui/src/image_attach/tests.rs:487 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep notice_block returning a single ContentBlock::Text wrapped in <attachment_notice> tags","Check whether the notice text now fails the contains assertions before the match","Update the arm if the notice legitimately became a composite block"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}