Skip to content

Commit a126e86

Browse files
committed
split snaps between 32-bit and 64-bit archs
1 parent b0dd0a3 commit a126e86

12 files changed

+1390
-7
lines changed

crates/rsonpath-lib/src/classification/memmem/nosimd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ where
4646
phantom: PhantomData<SM>,
4747
}
4848

49-
impl<'i, 'b, 'r, I, SM, R, const N: usize> SequentialMemmemClassifier<'i, 'b, 'r, I, SM, R, N>
49+
impl<'i, 'r, I, SM, R, const N: usize> SequentialMemmemClassifier<'i, '_, 'r, I, SM, R, N>
5050
where
5151
I: Input,
5252
SM: StringPatternMatcher,

crates/rsonpath-lib/src/string_pattern/matcher/avx2_64.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ impl StringPatternMatcher for Avx2StringMatcher64 {
247247
}
248248
// Fallthrough to alt match.
249249
}
250-
64.. => {
250+
_ => {
251+
// >= 64
251252
let rem_vec = _mm256_loadu_si256(rem_ptr.cast());
252253
let in_vec = _mm256_loadu_si256(in_ptr.cast());
253254
let cmpeq = _mm256_cmpeq_epi8(rem_vec, in_vec);

crates/rsonpath-lib/tests/engine_serialization_snapshots.rs

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,57 @@ mod ron {
1717
}
1818

1919
#[test]
20-
fn readme_query() -> Result<(), Box<dyn Error>> {
20+
#[cfg(target_pointer_width = "64")]
21+
fn readme_query_64() -> Result<(), Box<dyn Error>> {
2122
assert_ron_snapshot!(&engine("$.jsonpath[*]")?);
2223
Ok(())
2324
}
2425

2526
#[test]
26-
fn jsonpath_example_query() -> Result<(), Box<dyn Error>> {
27+
#[cfg(target_pointer_width = "32")]
28+
fn readme_query_32() -> Result<(), Box<dyn Error>> {
29+
assert_ron_snapshot!(&engine("$.jsonpath[*]")?);
30+
Ok(())
31+
}
32+
33+
#[test]
34+
#[cfg(target_pointer_width = "64")]
35+
fn jsonpath_example_query_64() -> Result<(), Box<dyn Error>> {
36+
assert_ron_snapshot!(&engine("$..phoneNumbers[*].number")?);
37+
Ok(())
38+
}
39+
40+
#[test]
41+
#[cfg(target_pointer_width = "32")]
42+
fn jsonpath_example_query_32() -> Result<(), Box<dyn Error>> {
2743
assert_ron_snapshot!(&engine("$..phoneNumbers[*].number")?);
2844
Ok(())
2945
}
3046

3147
#[test]
32-
fn real_life_query() -> Result<(), Box<dyn Error>> {
48+
#[cfg(target_pointer_width = "64")]
49+
fn real_life_query_64() -> Result<(), Box<dyn Error>> {
3350
assert_ron_snapshot!(&engine("$.personal.details.contact.information.phones.home")?);
3451
Ok(())
3552
}
3653

3754
#[test]
38-
fn slice() -> Result<(), Box<dyn Error>> {
55+
#[cfg(target_pointer_width = "32")]
56+
fn real_life_query_32() -> Result<(), Box<dyn Error>> {
57+
assert_ron_snapshot!(&engine("$.personal.details.contact.information.phones.home")?);
58+
Ok(())
59+
}
60+
61+
#[test]
62+
#[cfg(target_pointer_width = "64")]
63+
fn slice_64() -> Result<(), Box<dyn Error>> {
64+
assert_ron_snapshot!(&engine("$..entries[3:5:7]")?);
65+
Ok(())
66+
}
67+
68+
#[test]
69+
#[cfg(target_pointer_width = "32")]
70+
fn slice_32() -> Result<(), Box<dyn Error>> {
3971
assert_ron_snapshot!(&engine("$..entries[3:5:7]")?);
4072
Ok(())
4173
}

crates/rsonpath-lib/tests/snapshots/engine_serialization_snapshots__ron__empty_query.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/rsonpath-lib/tests/engine_serialization_snapshots.rs
33
expression: "&engine(\"$\")?"
4-
snapshot_kind: text
54
---
65
(V1, Automaton(
76
states: [

0 commit comments

Comments
 (0)