use rustine::parse_and_run;
#[test]
fn percent_encoded_space() {
let src = "\
grammar main:
match /.+/:
out.create(\"root/item\", \"hello%20world\")
";
let json = parse_and_run(src, "main", "x").expect("exec");
assert!(
json.contains("hello world"),
"percent-encoded %20 should be decoded to space: {json}"
);
}
#[test]
fn plus_decoded_as_space() {
let src = "\
grammar main:
match /.+/:
out.create(\"root/item\", \"a+b\")
";
let json = parse_and_run(src, "main", "x").expect("exec");
assert!(json.contains("a+b"), "+ should NOT be decoded to space: {json}");
}