Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any: Fail to deserialise $bytes with from JSON #7

Open
aDotInTheVoid opened this issue Sep 3, 2023 · 0 comments
Open

any: Fail to deserialise $bytes with from JSON #7

aDotInTheVoid opened this issue Sep 3, 2023 · 0 comments

Comments

@aDotInTheVoid
Copy link
Owner

#[test]
fn bytes_from_json() {
    let i = to_any(json!({"exampleBytes": {
        "$bytes": "nFERjvLLiw9qm45JrqH9QTzyC2Lu1Xb4ne6+sBrCzI0"
    }}))
    .unwrap();

    assert_eq!(
        i,
        any!({
            "exampleBytes": vec![0x9c, 0x51, 0x11]
        })
    )
}

running 1 test
test any::tests::bytes_from_json ... FAILED

failures:

---- any::tests::bytes_from_json stdout ----
thread 'any::tests::bytes_from_json' panicked at 'assertion failed: `(left == right)`
  left: `Map({"exampleBytes": Map({"$bytes": String("nFERjvLLiw9qm45JrqH9QTzyC2Lu1Xb4ne6+sBrCzI0")})})`,
 right: `Map({"exampleBytes": Bytes(Bytes { bytes: [156, 81, 17] })})`', triphosphate-vocab/src/any/tests.rs:74:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    any::tests::bytes_from_json

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 25 filtered out; finished in 0.00s

error: test failed, to rerun pass `-p triphosphate-vocab --lib`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant