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

Function test_tokenize_rust_source

atomic-repository/src/semantic_regen.rs:837–854  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

835
836 #[test]
837 fn test_tokenize_rust_source() {
838 let content = br#"use std::io;
839
840/// A greeting function.
841fn greet(name: &str) -> String {
842 format!("Hello, {}!", name)
843}
844
845fn main() {
846 let name = "World";
847 println!("{}", greet(name));
848}
849"#;
850 let ops = tokenize_content_for_display("src/main.rs", content, Encoding::Utf8);
851
852 assert!(ops.line_count() >= 10);
853 assert!(ops.token_count() > ops.line_count()); // more tokens than lines
854 }
855
856 // ── detect_encoding ────────────────────────────────────────────
857

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected