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/unicode-ident/tests/compare.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 / unicode-ident / tests / compare.rs` 68 lines ยท 1803 bytes Raw Blame History 1 #![allow( 2 clippy::incompatible_msrv, // https://github.com/rust-lang/rust-clippy/issues/12257 3 )] 4 5 mod fst; 6 mod roaring; 7 mod trie; 8 9 #[test] 10 fn compare_all_implementations() { 11 let xid_start_fst = fst::xid_start_fst(); 12 let xid_continue_fst = fst::xid_continue_fst(); 13 let xid_start_roaring = roaring::xid_start_bitmap(); 14 let xid_continue_roaring = roaring::xid_continue_bitmap(); 15 16 for ch in '\0'..=char::MAX { 17 let thought_to_be_start = unicode_ident::is_xid_start(ch); 18 let thought_to_be_continue = unicode_ident::is_xid_continue(ch); 19 20 // unicode-xid 21 assert_eq!( 22 thought_to_be_start, 23 unicode_xid::UnicodeXID::is_xid_start(ch), 24 "{ch:?}", 25 ); 26 assert_eq!( 27 thought_to_be_continue, 28 unicode_xid::UnicodeXID::is_xid_continue(ch), 29 "{ch:?}", 30 ); 31 32 // ucd-trie 33 assert_eq!( 34 thought_to_be_start, 35 trie::XID_START.contains_char(ch), 36 "{ch:?}", 37 ); 38 assert_eq!( 39 thought_to_be_continue, 40 trie::XID_CONTINUE.contains_char(ch), 41 "{ch:?}", 42 ); 43 44 // fst 45 assert_eq!( 46 thought_to_be_start, 47 xid_start_fst.contains((ch as u32).to_be_bytes()), 48 "{ch:?}", 49 ); 50 assert_eq!( 51 thought_to_be_continue, 52 xid_continue_fst.contains((ch as u32).to_be_bytes()), 53 "{ch:?}", 54 ); 55 56 // roaring 57 assert_eq!( 58 thought_to_be_start, 59 xid_start_roaring.contains(ch as u32), 60 "{ch:?}", 61 ); 62 assert_eq!( 63 thought_to_be_continue, 64 xid_continue_roaring.contains(ch as u32), 65 "{ch:?}", 66 ); 67 } 68 }