Skip to content

Commit 6674953

Browse files
authored
improve coverage in aarch64 SIMD (#105)
1 parent f71024f commit 6674953

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/jiter/tests/main.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,24 @@ fn bad_high_order_string_tail() {
615615
assert_eq!(e.description(&bytes), "invalid unicode code point at line 1 column 5")
616616
}
617617

618+
#[test]
619+
fn simd_string_sizes() {
620+
for i in 0..100 {
621+
let mut json = vec![b'"'];
622+
json.extend(iter::repeat(b'a').take(i));
623+
json.push(b'"');
624+
json.extend(iter::repeat(b' ').take(40));
625+
626+
let value = JsonValue::parse(&json, false).unwrap();
627+
let s = match value {
628+
JsonValue::Str(s) => s,
629+
_ => panic!("unexpected value {value:?}"),
630+
};
631+
assert_eq!(s.len(), i);
632+
assert!(s.as_bytes().iter().all(|&b| b == b'a'));
633+
}
634+
}
635+
618636
#[test]
619637
fn udb_string() {
620638
let bytes: Vec<u8> = vec![34, 92, 117, 100, 66, 100, 100, 92, 117, 100, 70, 100, 100, 34];

0 commit comments

Comments
 (0)