()
| 336 | |
| 337 | #[test] |
| 338 | fn line_comment_opaque() { |
| 339 | let segs = segments("SELECT col -- has <-> in comment\nFROM t"); |
| 340 | // The segment after the newline belongs to a new Text segment. |
| 341 | assert!( |
| 342 | segs.iter() |
| 343 | .any(|s| matches!(s, SqlSegment::LineComment(c) if c.contains("<->"))) |
| 344 | ); |
| 345 | assert!( |
| 346 | segs.iter() |
| 347 | .any(|s| matches!(s, SqlSegment::Text(t) if t.contains("FROM"))) |
| 348 | ); |
| 349 | // `<->` must not appear in any Text segment. |
| 350 | for s in &segs { |
| 351 | if let SqlSegment::Text(t) = s { |
| 352 | assert!(!t.contains("<->"), "unexpected <-> in Text: {t}"); |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | #[test] |
| 358 | fn block_comment_opaque() { |
nothing calls this directly
no test coverage detected