Build a Go-like source file with `count` distinct top-level functions, each with a unique, greppable marker line.
(count: usize)
| 1056 | /// Build a Go-like source file with `count` distinct top-level functions, |
| 1057 | /// each with a unique, greppable marker line. |
| 1058 | fn build_source(count: usize) -> String { |
| 1059 | let mut out = String::new(); |
| 1060 | out.push_str("package main\n\n"); |
| 1061 | for i in 0..count { |
| 1062 | out.push_str(&format!( |
| 1063 | "func step{i}() int {{\n // marker[{i}]\n return {i}\n}}\n\n" |
| 1064 | )); |
| 1065 | } |
| 1066 | out |
| 1067 | } |
| 1068 | |
| 1069 | fn count_occurrences(content: &str, pattern: &str) -> usize { |
| 1070 | content.matches(pattern).count() |
no outgoing calls
no test coverage detected