Sha256: 38d7e3b6c515b881078ebd21ca8063d2ca105cd319695d29538f879e37f091b5

Contents?: true

Size: 362 Bytes

Versions: 31

Compression:

Stored size: 362 Bytes

Contents

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

#[test]
fn test() {
    let float = 5.55f32;
    let value = serde_json::to_value(float).unwrap();
    let json = serde_json::to_string(&value).unwrap();

    // If the f32 were cast to f64 by Value before serialization, then this
    // would incorrectly serialize as 5.550000190734863.
    assert_eq!(json, "5.55");
}

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/serde_json-1.0.137/tests/regression/issue1004.rs
wasmtime-28.0.0 ./ext/cargo-vendor/serde_json-1.0.135/tests/regression/issue1004.rs
wasmtime-27.0.0 ./ext/cargo-vendor/serde_json-1.0.133/tests/regression/issue1004.rs
wasmtime-26.0.0 ./ext/cargo-vendor/serde_json-1.0.132/tests/regression/issue1004.rs
wasmtime-25.0.2 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue1004.rs
wasmtime-25.0.1 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue1004.rs
wasmtime-25.0.0 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue1004.rs
wasmtime-24.0.0 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue1004.rs
wasmtime-23.0.2 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-22.0.0 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-21.0.1 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-20.0.2 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-20.0.0 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-18.0.3 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-17.0.1 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-17.0.0 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-16.0.0 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-15.0.1 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-15.0.0 ./ext/cargo-vendor/serde_json-1.0.111/tests/regression/issue1004.rs
wasmtime-14.0.4 ./ext/cargo-vendor/serde_json-1.0.107/tests/regression/issue1004.rs