()
| 371 | |
| 372 | #[test] |
| 373 | fn test_syntax_error() -> Result<()> { |
| 374 | // create a table with a column of type varchar |
| 375 | let query = "CREATE EXTERNAL TABLE t(c1 int) STORED AS CSV PARTITIONED BY (c1, p1 /*int*/int/*int*/) LOCATION 'foo.csv'"; |
| 376 | let spans = get_spans(query); |
| 377 | match DFParser::parse_sql(query) { |
| 378 | Ok(_) => panic!("expected error"), |
| 379 | Err(err) => match err.diagnostic() { |
| 380 | Some(diag) => { |
| 381 | let diag = diag.clone(); |
| 382 | assert_snapshot!(diag.message, @"Expected: ',' or ')' after partition definition, found: int at Line: 1, Column: 77"); |
| 383 | println!("{spans:?}"); |
| 384 | assert_eq!(diag.span, Some(spans["int"])); |
| 385 | Ok(()) |
| 386 | } |
| 387 | None => { |
| 388 | panic!("expected diagnostic") |
| 389 | } |
| 390 | }, |
| 391 | } |
| 392 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…