Skip to content

Json parser successfully parses malformed json without raising an issue #30

Closed
@Rumata888

Description

@Rumata888

Aim

Test if malformed input is handled correctly

Expected Behavior

Assertion failure (the test should have failed

Bug

Json parser ignores ""}" in the end

To Reproduce

#[test(should_fail)]
fn closing_bracket() {
    let json_string = "{ } \"}";

    let json_string_bytes = json_string.as_bytes();
    let mut json_buffer = [32; 512];
    for i in 0..json_string_bytes.len() {
        json_buffer[512 - json_string_bytes.len() + i] = json_string_bytes[i];
    }
    let json = JSON512b::parse_json(json_buffer);
}

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

nargo version = 1.0.0-beta.1 noirc version = 1.0.0-beta.1+6d85cd6d52eebdaa7a91a019dddf21df4351f707

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions