Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/litemap/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 628 B image not shown  

Quelle  serde.rs   Sprache: unbekannt

 
Spracherkennung für: .rs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use litemap::LiteMap;

#[test]
fn test_ser() {
    let mut map = LiteMap::new_vec();
    map.insert(1, "jat");
    map.insert(4, "sei");
    map.insert(3, "saam");
    map.insert(2, "ji");

    let json_string = serde_json::to_string(&map).unwrap();

    assert_eq!(json_string, r#"{"1":"jat","2":"ji","3":"saam","4":"sei"}"#);

    let new_map = serde_json::from_str(&json_string).unwrap();

    assert_eq!(map, new_map);
}

[ Dauer der Verarbeitung: 0.37 Sekunden  ]