()
| 835 | |
| 836 | #[test] |
| 837 | fn test_tokenize_rust_source() { |
| 838 | let content = br#"use std::io; |
| 839 | |
| 840 | /// A greeting function. |
| 841 | fn greet(name: &str) -> String { |
| 842 | format!("Hello, {}!", name) |
| 843 | } |
| 844 | |
| 845 | fn 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 |
nothing calls this directly
no test coverage detected