]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/pass/wtf8.rs
Auto merge of #104915 - weihanglo:update-cargo, r=ehuss
[rust.git] / src / tools / miri / tests / pass / wtf8.rs
1 //@only-target-windows
2
3 use std::ffi::{OsStr, OsString};
4 use std::os::windows::ffi::{OsStrExt, OsStringExt};
5
6 fn test1() {
7     let base = "a\té \u{7f}💩\r";
8     let mut base: Vec<u16> = OsStr::new(base).encode_wide().collect();
9     base.push(0xD800);
10     let _res = OsString::from_wide(&base);
11 }
12
13 fn test2() {
14     let mut base: Vec<u16> = OsStr::new("aé ").encode_wide().collect();
15     base.push(0xD83D);
16     let mut _res: Vec<u16> = OsString::from_wide(&base).encode_wide().collect();
17 }
18
19 fn main() {
20     test1();
21     test2();
22 }