Skip to content

Commit

Permalink
improve coverage in aarch64 SIMD
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed May 22, 2024
1 parent be454d6 commit 38f73f2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/jiter/tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,24 @@ fn bad_high_order_string_tail() {
assert_eq!(e.description(&bytes), "invalid unicode code point at line 1 column 5")
}

#[test]
fn simd_string_sizes() {
for i in 0..100 {
let mut json = vec![b'"'];
json.extend(iter::repeat(b'a').take(i));
json.push(b'"');
json.extend(iter::repeat(b' ').take(40));

let value = JsonValue::parse(&json, false).unwrap();
let s = match value {
JsonValue::Str(s) => s,
_ => panic!("unexpected value {value:?}"),
};
assert_eq!(s.len(), i);
assert!(s.as_bytes().iter().all(|&b| b == b'a'));
}
}

#[test]
fn udb_string() {
let bytes: Vec<u8> = vec![34, 92, 117, 100, 66, 100, 100, 92, 117, 100, 70, 100, 100, 34];
Expand Down

0 comments on commit 38f73f2

Please sign in to comment.