{"record":{"id":"5bb27a44457011a1","repo":"jdx/mise","slug":"expected-block-edit","errorCode":null,"errorMessage":"expected block edit","messagePattern":"expected block edit","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/shell_activation.rs","lineNumber":224,"sourceCode":"            ShellActivationTarget::Bashrc,\n            ShellActivationMode::Activate,\n        );\n        assert_eq!(request.target, ShellActivationTarget::Bashrc);\n        assert_eq!(request.shell, ShellActivationShell::Bash);\n        assert_eq!(request.mode, ShellActivationMode::Activate);\n        assert_eq!(request.edit.path_raw, \"~/.bashrc\");\n        assert_eq!(request.edit.id, \"activate\");\n        match request.edit.op {\n            EditOp::Block {\n                source: BlockSource::Inline(block),\n                template,\n                comment,\n            } => {\n                assert_eq!(block, r#\"eval \"$(mise activate bash)\"\"#);\n                assert!(!template);\n                assert_eq!(comment, \"#\");\n            }\n            _ => panic!(\"expected block edit\"),\n        }\n    }\n\n    #[test]\n    fn request_for_zprofile_shims() {\n        let request = ShellActivationRequest::new(\n            ShellActivationTarget::Zprofile,\n            ShellActivationMode::Shims,\n        );\n        assert_eq!(request.edit.path_raw, \"~/.zprofile\");\n        match request.edit.op {\n            EditOp::Block {\n                source: BlockSource::Inline(block),\n                ..\n            } => assert_eq!(block, r#\"eval \"$(mise activate zsh --shims)\"\"#),\n            _ => panic!(\"expected block edit\"),\n        }\n    }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/shell_activation.rs#L206-L242","documentation":"Match-panic in the request_for_bashrc_activate unit test: the built ShellActivationRequest's edit op was not EditOp::Block with an inline BlockSource. It fires when the bashrc activation request builder produces a different EditOp (e.g. a line edit or external source) for ShellActivationTarget::Bashrc in Activate mode.","triggerScenarios":"Thrown at src/system/shell_activation.rs:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the bashrc activate request builder emit EditOp::Block with BlockSource::Inline containing the mise activation snippet","Confirm the block id ('activate'), comment, and template fields match the test's assertions","Re-run the shell_activation tests after changing the request builder"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}