Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/uguid/tests/test_serde.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / uguid / tests / test_serde.rs` 31 lines ยท 959 bytes Raw Blame History 1 // Copyright 2022 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 or the MIT license 5 // , at your 6 // option. This file may not be copied, modified, or distributed 7 // except according to those terms. 8 9 #![cfg(feature = "serde")] 10 11 use serde_test::Token; 12 use uguid::{guid, Guid}; 13 14 #[test] 15 fn test_serde() { 16 let guid = guid!("`01234567`-89ab-cdef-0123-`456789abcdef`"); 17 18 serde_test::assert_tokens( 19 &guid, 20 &[Token::Str("`01234567`-89ab-cdef-0123-`456789abcdef`")], 21 ); 22 23 serde_test::assert_de_tokens_error::( 24 &[Token::Str("1234")], 25 "GUID string has wrong length (expected 36 bytes)", 26 ); 27 28 serde_test::assert_de_tokens_error::( 29 &[Token::U64(1234)], 30 "invalid type: integer `1234`, expected a string in the format \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\""); 31 }