Skip to content

Dot notation path containing a colon character fails to match #75

@oshadmi

Description

@oshadmi

The following test fails due to the $.prod:id path

#[test]
fn colon_token_in_path() {
    setup();

    let payload = json!({
        "prod:id": "G637",
        "prod_name": "coffee table",
        "price": 194
    });

    select_and_then_compare("$.price", payload.clone(), json!([194]));

    select_and_then_compare("$.prod_name", payload.clone(), json!(["coffee table"]));

    select_and_then_compare("$.prod:id", payload.clone(), json!(["G637"]));
}

Returning an empty array []

test colon_token_in_path ... FAILED

failures:

---- colon_token_in_path stdout ----
thread 'colon_token_in_path' panicked at 'assertion failed: `(left == right)`
  left: `[]`,
 right: `[String("G637")]`: $.prod:id', tests/common.rs:41:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions