{"record":{"id":"0880ffd662fd7f34","repo":"tauri-apps/tauri","slug":"unexpected-value-for-test","errorCode":null,"errorMessage":"unexpected value for test","messagePattern":"unexpected value for test","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-macros/src/context.rs","lineNumber":106,"sourceCode":"              } else {\n                return Err(syn::Error::new(\n                  input.span(),\n                  \"unexpected value for capabilities\",\n                ));\n              }\n            }\n            \"assets\" => {\n              assets.replace(v.value);\n            }\n            \"test\" => {\n              if let Expr::Lit(ExprLit {\n                lit: Lit::Bool(LitBool { value, .. }),\n                ..\n              }) = v.value\n              {\n                test = value;\n              } else {\n                return Err(syn::Error::new(input.span(), \"unexpected value for test\"));\n              }\n            }\n            name => {\n              return Err(syn::Error::new(\n                input.span(),\n                format!(\"unknown attribute {name}\"),\n              ));\n            }\n          }\n        }\n        Meta::List(_) => {\n          return Err(syn::Error::new(input.span(), \"unexpected list input\"));\n        }\n      }\n\n      let _ = input.parse::<Token![,]>();\n    }\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-macros/src/context.rs#L88-L124","documentation":"Compile-time syn::Error from the generate_context! macro parser: the `test` key in the tauri context invocation was given a value that is not a boolean literal. Only Lit::Bool is accepted for this option.","triggerScenarios":"Writing `test = 1`, `test = \"true\"`, `test = cfg!(debug_assertions)`, or any non-bool-literal value in a `generate_context!` invocation.","commonSituations":"Attempting to make test mode conditional via cfg! or env! macros; quoting the boolean as a string by mistake.","solutions":["Use a plain boolean literal: test = true or test = false","Enable test mode conditionally by choosing between two generate_context! invocations with #[cfg(...)] attributes instead","Pass the string path argument directly if the goal was test mode (generate_context!(\"path\", test = true))"],"exampleFix":"// before\ntauri::generate_context!(\"tauri.conf.json\", test = cfg!(debug_assertions))\n// after\n#[cfg(debug_assertions)]\nconst CONTEXT: tauri::Context = tauri::generate_context!(\"tauri.conf.json\", test = true);\n#[cfg(not(debug_assertions))]\nconst CONTEXT: tauri::Context = tauri::generate_context!(\"tauri.conf.json\", test = false);","handlingStrategy":"validation","validationCode":"// test must be a bare boolean literal\nassert!(matches!(TEST_ATTR.as_str(), \"true\" | \"false\"), \"test = <bool literal> only\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only true/false literals for the test attribute","Use #[cfg] on separate generate_context! calls for conditional test mode","Do not quote the boolean"],"tags":["compile-time","macro","boolean","invalid-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}