about summary refs log tree commit diff
path: root/library/std/src/sys/pal/windows/api/tests.rs
blob: fab022c7b93d87728fbd18a65ca30571f250843a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::sys::pal::windows::api::{utf16, wide_str};

macro_rules! check_utf16 {
    ($str:literal) => {{
        assert!(wide_str!($str).iter().copied().eq($str.encode_utf16().chain([0])));
        assert!(utf16!($str).iter().copied().eq($str.encode_utf16()));
    }};
}

#[test]
fn test_utf16_macros() {
    check_utf16!("hello world");
    check_utf16!("€4.50");
    check_utf16!("𨉟呐㗂越");
    check_utf16!("Pchnąć w tę łódź jeża lub ośm skrzyń fig");
}