Sha256: 37ca5066022e9771e464184dba94adbad2a223d80d15513c6662d8ffca8536ee

Contents?: true

Size: 1.04 KB

Versions: 31

Compression:

Stored size: 1.04 KB

Contents

#![cfg(feature = "serde")]

use debugid::{CodeId, DebugId};
use uuid::Uuid;

#[test]
fn test_deserialize_debugid() {
    assert_eq!(
        DebugId::from_parts(
            Uuid::parse_str("dfb8e43a-f242-3d73-a453-aeb6a777ef75").unwrap(),
            0,
        ),
        serde_json::from_str("\"dfb8e43a-f242-3d73-a453-aeb6a777ef75\"").unwrap(),
    );
}

#[test]
fn test_serialize_debugid() {
    let id = DebugId::from_parts(
        Uuid::parse_str("dfb8e43a-f242-3d73-a453-aeb6a777ef75").unwrap(),
        0,
    );

    assert_eq!(
        "\"dfb8e43a-f242-3d73-a453-aeb6a777ef75\"",
        serde_json::to_string(&id).unwrap(),
    );
}

#[test]
fn test_deserialize_codeid() {
    assert_eq!(
        CodeId::new("dfb8e43af2423d73a453aeb6a777ef75".into()),
        serde_json::from_str("\"dfb8e43af2423d73a453aeb6a777ef75\"").unwrap(),
    );
}

#[test]
fn test_serialize_codeid() {
    assert_eq!(
        "\"dfb8e43af2423d73a453aeb6a777ef75\"",
        serde_json::to_string(&CodeId::new("dfb8e43af2423d73a453aeb6a777ef75".into())).unwrap(),
    );
}

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-28.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-27.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-26.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-25.0.2 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-25.0.1 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-25.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-24.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-23.0.2 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-22.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-21.0.1 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-20.0.2 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-20.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-18.0.3 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-17.0.1 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-17.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-16.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-15.0.1 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-15.0.0 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs
wasmtime-14.0.4 ./ext/cargo-vendor/debugid-0.8.0/tests/test_serde.rs