1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use std
const main = {
check("aaab", "aaa", "b")
check("aaa", "aaa", "")
check("aa", "aaa", "aa")
}
const check = {sl, pfx, expected
var r
r = sl
std.chomp(&r, pfx)
std.assert(std.sleq(r, expected), \
"expected chomp({}, {}) => {}, got {}\n", sl, pfx, expected, r)
}
|