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

Function test_tokenizer_operators

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

Source from the content-addressed store, hash-verified

284
285 #[test]
286 fn test_tokenizer_operators() {
287 let code = b"a == b && c != d";
288 let tokens: Vec<Token> = Tokenizer::new(code).collect();
289
290 let ops: Vec<_> = tokens
291 .iter()
292 .filter(|t| t.kind() == TokenKind::Operator)
293 .collect();
294 assert_eq!(ops.len(), 3);
295 assert_eq!(ops[0].as_str(), "==");
296 assert_eq!(ops[1].as_str(), "&&");
297 assert_eq!(ops[2].as_str(), "!=");
298 }
299
300 #[test]
301 fn test_tokenizer_arrow_operators() {

Callers

nothing calls this directly

Calls 3

collectMethod · 0.45
iterMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected