Test cases looped by hand
let t = read() then for _ in 0..t: around the program: @!multitest
let t: Int = read()
for _ in 0..t:
let n: Int = read()
let a = read<[n]Int>()
print(a.sum())@!multitest
let n: Int = read()
let a = read<[n]Int>()
print(a.sum())Why
C++ reads the test count in main and wraps the solution in while (t--). CP Lang writes the case boundary once: @!multitest on its own line reads the count and runs everything below it per case, and code above it (a sieve, a factorial table) runs once. The body loses a level of indentation, single-test and multitest files read the same, and switching a file between the two is one line. The fix replaces the count's let and the loop header with the divider and unindents the body. It does not fire when the body returns, which under the divider would end only the current case, or breaks or continues the case loop, or uses the count.
The practice it serves
A hand-written pattern the language or the standard library already says in one step.
Not flagged
A near miss: close to the pattern, but not it.
let t: Int = read()
for _ in 0..t:
let k: Int = read()
if k == 0: break
print(k)Turn it off
For one block, wrap it in with lint(test_count_loop: allow):. For a project, add test_count_loop = "allow" under [lints] in cp.toml.
Generated from spec/lints/test_count_loop, the same record the linter is built from.