{"record":{"id":"f422ae579c39bec6","repo":"rtk-ai/rtk","slug":"invalid-ctest-result-regex","errorCode":null,"errorMessage":"invalid ctest result regex","messagePattern":"invalid ctest result regex","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmds/system/ctest_cmd.rs","lineNumber":28,"sourceCode":"use crate::core::runner::{self, RunOptions};\nuse crate::core::truncate::{self, CAP_LIST, CAP_WARNINGS};\nuse crate::core::utils::{resolved_command, strip_ansi};\n\nconst MAX_SLOWEST: usize = 3;\nconst MAX_FAILURE_LINES: usize = CAP_WARNINGS;\nconst MAX_FAILURE_HEAD_LINES: usize = 2;\nconst MAX_FAILED_LIST_LINES: usize = CAP_LIST;\nconst MAX_DETECT_PREAMBLE_LINES: usize = 4;\n// Failure entries carry a header plus up to `MAX_FAILURE_LINES` detail lines each,\n// so this list deviates below `CAP_LIST`; the single-line skipped and raw-trailer\n// lists keep the full cap.\nconst MAX_FAILED_BLOCK_ENTRIES: usize = truncate::reduced(CAP_LIST, 5);\n\nstatic TEST_RE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(\n        r\"(?s)^\\s*(?:\\d+/(\\d+)\\s+)?Test\\s+#(\\d+):\\s+(.+?)\\s+\\.{2,}\\s*(?:\\*{3})?\\s*(.+?)\\s+([\\d.]+)\\s+sec\\s*$\",\n    )\n    .expect(\"invalid ctest result regex\")\n});\nstatic RESULT_PREFIX_RE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"^\\s*(?:\\d+/\\d+\\s+)?Test\\s+#\\d+:\")\n        .expect(\"invalid ctest result prefix regex\")\n});\nstatic RESULT_TERMINATOR_RE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"[\\d.]+\\s+sec\\s*$\").expect(\"invalid ctest result terminator regex\")\n});\nstatic START_RE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"^\\s*Start\\s+(\\d+):\\s*(.*?)\\s*$\").expect(\"invalid ctest start regex\")\n});\nstatic SUMMARY_RE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"^\\s*\\d+%\\s+tests passed,\\s+(\\d+)\\s+tests failed out of\\s+(\\d+)\")\n        .expect(\"invalid ctest summary regex\")\n});\nstatic TIME_RE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"^\\s*Total Test time \\(real\\)\\s+=\\s+([\\d.]+)\\s+sec\")\n        .expect(\"invalid ctest time regex\")","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/rtk-ai/rtk/blob/36788f6bd4932037caac5cbb1d15d6e2fb9f33da/src/cmds/system/ctest_cmd.rs#L10-L46","documentation":"A .expect() panic guard on the hardcoded ctest result-parsing regex at module load inside the ctest filter. The pattern is a static literal; this only fires if the regex source itself is invalid after an edit, never from runtime ctest output.","triggerScenarios":"Thrown at src/cmds/system/ctest_cmd.rs:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the regex literal for the ctest result pattern in src/cmds/system/ctest_cmd.rs","Check for unescaped parentheses, brackets, or repetition operators","Run cargo test ctest to verify the pattern compiles and parses fixtures correctly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"36788f6bd4932037caac5cbb1d15d6e2fb9f33da","analyzedAt":"2026-09-03T16:33:57.738Z","contentChangedAt":"2026-09-03T16:33:57.738Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}