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

Function test_tokenizer_string

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

Source from the content-addressed store, hash-verified

340
341 #[test]
342 fn test_tokenizer_string() {
343 let code = b"let s = \"hello world\";";
344 let tokens: Vec<Token> = Tokenizer::new(code).collect();
345
346 let strings: Vec<_> = tokens
347 .iter()
348 .filter(|t| t.kind() == TokenKind::String)
349 .collect();
350 assert_eq!(strings.len(), 1);
351 assert_eq!(strings[0].as_str(), "\"hello world\"");
352 }
353
354 #[test]
355 fn test_tokenizer_string_with_escape() {

Callers

nothing calls this directly

Calls 3

collectMethod · 0.45
iterMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected