{"record":{"id":"c1b4ee6424593e01","repo":"jdx/mise","slug":"expected-task-tool-selector-validation-to-fail","errorCode":null,"errorMessage":"expected task tool selector validation to fail","messagePattern":"expected task tool selector validation to fail","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/mod.rs","lineNumber":5926,"sourceCode":"            Some(&vec![toml::Value::Integer(1), toml::Value::Boolean(true)])\n        );\n\n        for (invalid, expected) in [\n            (\n                \"[tools]\\nnode = { version = \\\"20\\\", prefix = \\\"20\\\" }\\n\",\n                \"tool definition cannot specify both `version` and `prefix`\",\n            ),\n            (\n                \"[tools]\\nnode = { os = \\\"linux\\\" }\\n\",\n                \"tool definition must include exactly one of `version`, `path`, `prefix`, or `ref`\",\n            ),\n            (\n                \"[tools]\\nnode = { prefix = 20 }\\n\",\n                \"tool selector `prefix` must be a string\",\n            ),\n        ] {\n            let err = match toml::from_str::<TaskTools>(invalid) {\n                Ok(_) => panic!(\"expected task tool selector validation to fail\"),\n                Err(err) => err,\n            };\n            assert!(err.to_string().contains(expected), \"{err}\");\n        }\n    }\n\n    #[tokio::test]\n    async fn test_to_tool_arg_preserves_structured_core_options() {\n        use indexmap::IndexMap;\n\n        use crate::config::Config;\n\n        use super::{TaskToolValue, TaskToolValueMap};\n\n        let _config = Config::get().await.unwrap();\n        let tool = TaskToolValue::Map(TaskToolValueMap {\n            version: \"1.0.0\".to_string(),\n            opts: IndexMap::from([","sourceCodeStart":5908,"sourceCodeEnd":5944,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/mod.rs#L5908-L5944","documentation":"Panic in the task tool selector validation unit test: toml::from_str::<TaskTools> on an intentionally invalid [tools] definition succeeded instead of failing with the expected message (e.g. both version and prefix set, none of version/path/prefix/ref set, wrong prefix type). It fires when validation in the TaskTools deserializer is missing or its error text changed.","triggerScenarios":"Thrown at src/task/mod.rs:5926 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore/verify validation rejecting version+prefix together and requiring exactly one of version/path/prefix/ref","Ensure error messages match the expected strings in the test table exactly","Rerun the validation test loop over all invalid cases"],"exampleFix":null,"handlingStrategy":"validation","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"}