MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / line_comment_opaque

Function line_comment_opaque

nodedb-sql/src/parser/preprocess/lex.rs:338–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

segmentsFunction · 0.85

Tested by

no test coverage detected