Skip to content

Commit 6a69a39

Browse files
committed
more tests
Signed-off-by: Daniel King <[email protected]>
1 parent 7d95ff9 commit 6a69a39

File tree

19 files changed

+56
-50
lines changed

19 files changed

+56
-50
lines changed

encodings/sparse/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ mod test {
399399
#[should_panic(expected = "out of bounds")]
400400
fn test_scalar_at_oob() {
401401
let array = sparse_array(nullable_fill());
402-
let _ = array.scalar_at(10);
402+
array.scalar_at(10);
403403
}
404404

405405
#[test]

encodings/zstd/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,5 @@ fn test_sliced_array_children() {
188188
let compressed =
189189
ZstdArray::from_primitive(&PrimitiveArray::from_option_iter(data), 0, 100).unwrap();
190190
let sliced = compressed.slice(0..4);
191-
let _ = sliced.children();
191+
sliced.children();
192192
}

vortex-array/src/arrays/datetime/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn test_timestamp_fails_i32() {
159159
let ts = buffer![100i32].into_array();
160160
let ts_array = ts.into_array();
161161

162-
let _ = TemporalArray::new_timestamp(ts_array, TimeUnit::Seconds, None);
162+
TemporalArray::new_timestamp(ts_array, TimeUnit::Seconds, None);
163163
}
164164

165165
#[rstest]

vortex-array/src/arrays/list/tests.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ fn test_negative_offset_values() {
776776
let offsets = buffer![-1i32, 2, 4, 5].into_array();
777777
let validity = Validity::AllValid;
778778

779-
let _ = ListArray::try_new(elements, offsets, validity).unwrap();
779+
ListArray::try_new(elements, offsets, validity).unwrap();
780780
}
781781

782782
#[test]
@@ -786,7 +786,7 @@ fn test_unsorted_offsets() {
786786
let offsets = buffer![0u32, 3, 2, 5].into_array();
787787
let validity = Validity::AllValid;
788788

789-
let _ = ListArray::try_new(elements, offsets, validity).unwrap();
789+
ListArray::try_new(elements, offsets, validity).unwrap();
790790
}
791791

792792
#[test]
@@ -796,7 +796,7 @@ fn test_offset_exceeding_elements_length() {
796796
let offsets = buffer![0u32, 2, 4, 7].into_array();
797797
let validity = Validity::AllValid;
798798

799-
let _ = ListArray::try_new(elements, offsets, validity).unwrap();
799+
ListArray::try_new(elements, offsets, validity).unwrap();
800800
}
801801

802802
#[test]
@@ -809,7 +809,7 @@ fn test_validity_length_mismatch() {
809809
Nullability::Nullable,
810810
);
811811

812-
let _ = ListArray::try_new(elements, offsets, validity).unwrap();
812+
ListArray::try_new(elements, offsets, validity).unwrap();
813813
}
814814

815815
#[test]
@@ -819,7 +819,7 @@ fn test_nullable_offsets() {
819819
let offsets = PrimitiveArray::from_option_iter([Some(0u32), Some(2), None, Some(5)]);
820820
let validity = Validity::AllValid;
821821

822-
let _ = ListArray::try_new(elements, offsets.into_array(), validity).unwrap();
822+
ListArray::try_new(elements, offsets.into_array(), validity).unwrap();
823823
}
824824

825825
#[test]
@@ -829,7 +829,7 @@ fn test_empty_offsets_array() {
829829
let offsets = PrimitiveArray::empty::<u32>(Nullability::NonNullable);
830830
let validity = Validity::AllValid;
831831

832-
let _ = ListArray::try_new(elements, offsets.into_array(), validity).unwrap();
832+
ListArray::try_new(elements, offsets.into_array(), validity).unwrap();
833833
}
834834

835835
#[test]
@@ -839,7 +839,7 @@ fn test_non_integer_offsets() {
839839
let offsets = buffer![0.0f32, 2.0, 4.0, 5.0].into_array();
840840
let validity = Validity::AllValid;
841841

842-
let _ = ListArray::try_new(elements, offsets, validity).unwrap();
842+
ListArray::try_new(elements, offsets, validity).unwrap();
843843
}
844844

845845
#[test]

vortex-array/src/compute/conformance/cast.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn test_cast_from_bool(array: &dyn Array, nullability: Nullability) {
111111
test_cast_nullability_changes(array, &DType::Bool(Nullability::Nullable));
112112
if nullability == Nullability::Nullable {
113113
// Try casting to non-nullable (may fail if nulls present)
114-
let _ = cast(array, &DType::Bool(Nullability::NonNullable));
114+
cast(array, &DType::Bool(Nullability::NonNullable)).vortex_unwrap();
115115
}
116116

117117
// Test bool to numeric casts (true -> 1, false -> 0)
@@ -126,10 +126,11 @@ fn test_cast_from_decimal(array: &dyn Array, nullability: Nullability) {
126126
test_cast_nullability_changes(array, &DType::Decimal(*decimal_type, Nullability::Nullable));
127127
if nullability == Nullability::Nullable {
128128
// Try casting to non-nullable (may fail if nulls present)
129-
let _ = cast(
129+
cast(
130130
array,
131131
&DType::Decimal(*decimal_type, Nullability::NonNullable),
132-
);
132+
)
133+
.vortex_unwrap();
133134
}
134135
}
135136
}
@@ -139,7 +140,7 @@ fn test_cast_from_utf8(array: &dyn Array, nullability: Nullability) {
139140
test_cast_nullability_changes(array, &DType::Utf8(Nullability::Nullable));
140141
if nullability == Nullability::Nullable {
141142
// Try casting to non-nullable (may fail if nulls present)
142-
let _ = cast(array, &DType::Utf8(Nullability::NonNullable));
143+
cast(array, &DType::Utf8(Nullability::NonNullable)).vortex_unwrap();
143144
}
144145

145146
// UTF-8 strings can potentially be cast to Binary
@@ -151,7 +152,7 @@ fn test_cast_from_binary(array: &dyn Array, nullability: Nullability) {
151152
test_cast_nullability_changes(array, &DType::Binary(Nullability::Nullable));
152153
if nullability == Nullability::Nullable {
153154
// Try casting to non-nullable (may fail if nulls present)
154-
let _ = cast(array, &DType::Binary(Nullability::NonNullable));
155+
cast(array, &DType::Binary(Nullability::NonNullable)).vortex_unwrap();
155156
}
156157

157158
// Binary might be castable to UTF-8 if it contains valid UTF-8
@@ -164,10 +165,11 @@ fn test_cast_from_struct(array: &dyn Array, nullability: Nullability) {
164165
test_cast_nullability_changes(array, &DType::Struct(fields.clone(), Nullability::Nullable));
165166
if nullability == Nullability::Nullable {
166167
// Try casting to non-nullable (may fail if nulls present)
167-
let _ = cast(
168+
cast(
168169
array,
169170
&DType::Struct(fields.clone(), Nullability::NonNullable),
170-
);
171+
)
172+
.vortex_unwrap();
171173
}
172174
}
173175
}
@@ -181,10 +183,11 @@ fn test_cast_from_list(array: &dyn Array, nullability: Nullability) {
181183
);
182184
if nullability == Nullability::Nullable {
183185
// Try casting to non-nullable (may fail if nulls present)
184-
let _ = cast(
186+
cast(
185187
array,
186188
&DType::List(element_type.clone(), Nullability::NonNullable),
187-
);
189+
)
190+
.vortex_unwrap();
188191
}
189192
}
190193
}
@@ -198,10 +201,11 @@ fn test_cast_from_fixed_size_list(array: &dyn Array, nullability: Nullability) {
198201
);
199202
if nullability == Nullability::Nullable {
200203
// Try casting to non-nullable (may fail if nulls present)
201-
let _ = cast(
204+
cast(
202205
array,
203206
&DType::FixedSizeList(element_type.clone(), *list_size, Nullability::NonNullable),
204-
);
207+
)
208+
.vortex_unwrap();
205209
}
206210
}
207211
}

vortex-array/src/patches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ mod test {
16751675

16761676
// Mask with wrong length
16771677
let mask = Mask::from_iter([false, false, true, false, false]);
1678-
let _ = patches.mask(&mask).unwrap();
1678+
patches.mask(&mask).unwrap();
16791679
}
16801680

16811681
#[test]

vortex-datafusion/src/persistent/sink.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ mod tests {
385385
register_vortex_format_factory(factory, &mut session_state_builder);
386386
let session = SessionContext::new_with_state(session_state_builder.build());
387387

388-
let _ = session
388+
let _unused = session
389389
.sql(&format!(
390390
"CREATE EXTERNAL TABLE my_tbl \
391391
(c1 VARCHAR NOT NULL, c2 INT NOT NULL) \

vortex-dtype/src/arrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ mod test {
337337
#[test]
338338
#[should_panic]
339339
fn test_dtype_conversion_panics() {
340-
let _unused = DType::Extension(Arc::new(ExtDType::new(
340+
DType::Extension(Arc::new(ExtDType::new(
341341
ExtID::from("my-fake-ext-dtype"),
342342
Arc::new(DType::Utf8(Nullability::NonNullable)),
343343
None,
@@ -380,6 +380,6 @@ mod test {
380380
#[should_panic]
381381
fn test_schema_conversion_panics(the_struct: StructFields) {
382382
let schema_null = DType::Struct(the_struct, Nullability::Nullable);
383-
let _unused = schema_null.to_arrow_schema().unwrap();
383+
schema_null.to_arrow_schema().unwrap();
384384
}
385385
}

vortex-expr/src/exprs/cast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ mod tests {
139139
use vortex_array::arrays::StructArray;
140140
use vortex_buffer::buffer;
141141
use vortex_dtype::{DType, Nullability, PType};
142+
use vortex_error::VortexUnwrap as _;
142143

143144
use crate::{ExprRef, Scope, cast, get_item, root, test_harness};
144145

@@ -156,7 +157,7 @@ mod tests {
156157
#[test]
157158
fn replace_children() {
158159
let expr = cast(root(), DType::Bool(Nullability::Nullable));
159-
let _ = expr.with_children(vec![root()]);
160+
expr.with_children(vec![root()]).vortex_unwrap();
160161
}
161162

162163
#[test]

vortex-expr/src/exprs/is_null.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ mod tests {
132132
use vortex_array::stats::Stat;
133133
use vortex_buffer::buffer;
134134
use vortex_dtype::{DType, Field, FieldPath, FieldPathSet, Nullability};
135+
use vortex_error::VortexUnwrap as _;
135136
use vortex_scalar::Scalar;
136137
use vortex_utils::aliases::hash_map::HashMap;
137138

@@ -151,7 +152,7 @@ mod tests {
151152
#[test]
152153
fn replace_children() {
153154
let expr = is_null(root());
154-
let _ = expr.with_children(vec![root()]);
155+
expr.with_children(vec![root()]).vortex_unwrap();
155156
}
156157

157158
#[test]

0 commit comments

Comments
 (0)