Formats a detailed error message for the test case into a string.
(&self, name: &str)
| 263 | |
| 264 | /// Formats a detailed error message for the test case into a string. |
| 265 | fn format_error(&self, name: &str) -> String { |
| 266 | match self { |
| 267 | TestCaseResult::Success => String::new(), |
| 268 | TestCaseResult::ResultsMismatch { original, unparsed } => { |
| 269 | format!( |
| 270 | "Results mismatch for {name}.\nOriginal SQL:\n{original}\n\nUnparsed SQL:\n{unparsed}" |
| 271 | ) |
| 272 | } |
| 273 | TestCaseResult::UnparseError { original, error } => { |
| 274 | format!("Unparse error for {name}: {error}\nOriginal SQL:\n{original}") |
| 275 | } |
| 276 | TestCaseResult::ExecutionError { original, error } => { |
| 277 | format!("Execution error for {name}: {error}\nOriginal SQL:\n{original}") |
| 278 | } |
| 279 | TestCaseResult::UnparsedExecutionError { |
| 280 | original, |
| 281 | unparsed, |
| 282 | error, |
| 283 | } => { |
| 284 | format!( |
| 285 | "Unparsed execution error for {name}: {error}\nOriginal SQL:\n{original}\n\nUnparsed SQL:\n{unparsed}" |
| 286 | ) |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | /// Executes a roundtrip test for a single SQL query. |
no test coverage detected