Skip to content

Commit a7acf3d

Browse files
authored
Convert prettyprint tests in arrow-cast to insta inline snapshots (#9472)
# Rationale for this change The motivation for this PR is to create to improve the testing infrastructure as a precursor to the following PR: - #9221 @Jefffrey seemed to be in favor of using `insta` for more tests: #9221 (comment) # What changes are included in this PR? This PR does not do logic changes, but is a straightforward translation of the current tests. More test cases, especially around escape sequences can be added in follow up PRs. # Are these changes tested? Yes, to review we still need to manually confirm that no test cases changed accidentally. # Are there any user-facing changes? No.
1 parent a20753c commit a7acf3d

6 files changed

Lines changed: 460 additions & 568 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ simdutf8 = { version = "0.1.5", default-features = false }
112112

113113
criterion = { version = "0.8.0", default-features = false }
114114

115+
insta = { version = "1.46.3", default-features = false }
116+
115117
# release inherited profile keeping debug information and symbols
116118
# for mem/cpu profiling
117119
[profile.profiling]

arrow-cast/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ ryu = "1.0.16"
5858
[dev-dependencies]
5959
criterion = { workspace = true, default-features = false }
6060
half = { version = "2.1", default-features = false }
61+
insta = { workspace = true }
6162
rand = "0.9"
6263

6364
[[bench]]

arrow-cast/src/base64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ mod tests {
106106
let data: BinaryArray = (0..len)
107107
.map(|_| {
108108
let len = rng.random_range(0..16);
109-
Some((0..len).map(|_| rng.random()).collect::<Vec<u8>>())
109+
Some((0..len).map(|_| rng.random::<u8>()).collect::<Vec<u8>>())
110110
})
111111
.collect();
112112

0 commit comments

Comments
 (0)