Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_utils.rs

  Sprache: Rust
 

// 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 ).

/// Take a VarULE type and serialize it both in human and machine readable contexts,
/// and ensure it roundtrips correctly
///
/// Note that the concrete type may need to be explicitly specified to prevent issues with
/// https://github.com/rust-lang/rust/issues/130180
#[cfg(feature = "serde")]
pub(cratefn assert_serde_roundtrips<T>(var: &T)
where
    T: crate::ule::VarULE + ?Sized + serde::Serialize,
    for<'a> Box<T>: serde::Deserialize<'a>,
    for<'a> &'a T: serde::Deserialize<'a>,
    T: core::fmt::Debug + PartialEq,
{
    let bincode = bincode::serialize(var).unwrap();
    let deserialized: &T = bincode::deserialize(&bincode).unwrap();
    let deserialized_box: Box<T> = bincode::deserialize(&bincode).unwrap();
    assert_eq!(var, deserialized, "Single element roundtrips with bincode");
    assert_eq!(
        var, &*deserialized_box,
        "Single element roundtrips with bincode"
    );

    let json = serde_json::to_string(var).unwrap();
    let deserialized: Box<T> = serde_json::from_str(&json).unwrap();
    assert_eq!(var, &*deserialized, "Single element roundtrips with serde");
}

Messung V0.5 in Prozent
C=74 H=100 G=87

¤ Dauer der Verarbeitung: 0.2 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=434850
#Domains=661743