chore(rule_generator): preserve escaped string in test code (#160)

This commit is contained in:
yangchenye 2023-03-08 22:07:55 -06:00 committed by GitHub
parent 1ea463e0bb
commit bc2c175472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,7 +93,7 @@ fn parse_test_code<'a>(source_text: &'a str, expr: &'a Expression) -> Option<Cow
let option_code = option_code.map_or(Cow::Borrowed("None"), |option_code| {
Cow::Owned(format!("Some(serde_json::json!({option_code}))"))
});
Cow::Owned(format!(r#"("{test_code}", {option_code})"#))
Cow::Owned(format!(r#"({test_code:?}, {option_code})"#))
})
}