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

Function test_tokenizer_words_and_spaces

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

Source from the content-addressed store, hash-verified

228
229 #[test]
230 fn test_tokenizer_words_and_spaces() {
231 let tokens: Vec<Token> = Tokenizer::new(b"hello world").collect();
232 assert_eq!(tokens.len(), 3);
233 assert_eq!(tokens[0].as_str(), "hello");
234 assert_eq!(tokens[0].kind(), TokenKind::Word);
235 assert_eq!(tokens[1].as_str(), " ");
236 assert_eq!(tokens[1].kind(), TokenKind::Whitespace);
237 assert_eq!(tokens[2].as_str(), "world");
238 assert_eq!(tokens[2].kind(), TokenKind::Word);
239 }
240
241 #[test]
242 fn test_tokenizer_merged_whitespace() {

Callers

nothing calls this directly

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected