Skip to content

Commit 127e6e9

Browse files
kkent030315x0rb3l
andcommitted
fix invalid surrogate pair test
Co-Authored-By: Robel Campbell <[email protected]>
1 parent e6ebca6 commit 127e6e9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/pe/resource.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,10 +1883,8 @@ mod tests {
18831883
// Invalid surrogate pair (lone high surrogate)
18841884
let bytes = &[0x3d, 0xd8, 0x41, 0x00]; // High surrogate followed by 'A'
18851885
let result = to_utf16_string(bytes);
1886-
// Should still return Some due to from_utf16_lossy
1887-
assert!(result.is_some());
1888-
let string = result.unwrap();
1889-
assert!(string.contains('A'));
1886+
// Should return None due to from_utf16
1887+
assert_eq!(result, None);
18901888
}
18911889

18921890
#[test]

0 commit comments

Comments
 (0)