MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_tokenizer_comment

Function test_tokenizer_comment

atomic-core/src/diff/token/tests.rs:378–388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376
377 #[test]
378 fn test_tokenizer_comment() {
379 let code = b"x = 1; // this is a comment";
380 let tokens: Vec<Token> = Tokenizer::new(code).collect();
381
382 let comments: Vec<_> = tokens
383 .iter()
384 .filter(|t| t.kind() == TokenKind::Comment)
385 .collect();
386 assert_eq!(comments.len(), 1);
387 assert_eq!(comments[0].as_str(), "// this is a comment");
388 }
389
390 #[test]
391 fn test_tokenizer_comment_stops_at_newline() {

Callers

nothing calls this directly

Calls 3

collectMethod · 0.45
iterMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected