ref: 2fca1caa1935baf0473efc367e24dab57c52517d
dir: /lib/escfmt/test/escre.myr/
use std
use escfmt
use testr
const main = {
testr.run([\
[.name="unchanged", .fn={ctx
var s = std.fmt("{}", escfmt.url("word"))
testr.check(ctx, std.eq("word", s), std.fmt("mismatched escape {}", s))
std.slfree(s)
}],
[.name="randomcrud", .fn={ctx
var s = std.fmt("{}", escfmt.re("^:/?#[]@!$&'()*+,;=%"))
testr.check(ctx, \
std.eq("\\^:/\\?#\\[\\]@!\\$&'\\(\\)\\*\\+,;=%", s), \
std.fmt("mismatched escape {}", s))
std.slfree(s)
}],
][:])
}