mr-adult / JFC

A CLI tool for working with malformed JSON
0 stars 0 forks source link

Out of bounds panic on multi-line string #1

Closed mr-adult closed 5 months ago

mr-adult commented 5 months ago

I'm getting an out of bounds panic when the JSON contains a multi-line string (or one that doesn't escape its \n characters correctly).

#[test]
fn multi_line_string() {
    let str = "\"this is a string\nthat spans multiple lines\n\nend\"";

    println!("{}", super::format(str, None).0);
    println!("{}", super::parse(str).0.to_string_pretty());
}
mr-adult commented 5 months ago

Fixed in commit a2e78fe71e9c2ea3176f50eea85e590e91cdabde