cargo mutants: missed mutants in vortex-temporal
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 67/100
Hướng nghiên cứu
Start with the five surviving mutants listed in the issue and inspect the related tests in vortex-extensions/vortex-temporal/src/change_time_unit.rs, date_to_timestamp.rs, and hegel.rs. Run the shown cargo mutants commands to reproduce the gaps, then add tests that fail for each mutant; done when all five mutants are killed by the tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The nightly run at fdb9507c04e2939724aa39c298653a8ea3fd3b49 found 5 mutants in vortex-temporal that survive the tests. They are in code that changed during the last day.
Artifacts:
- mutants-0
- mutants-2
- mutants-13
- mutants-1
- mutants-3
- mutants-6
- mutants-10
- mutants-5
- mutants-4
- mutants-11
- mutants-9
- mutants-12
- mutants-15
- mutants-14
vortex-extensions/vortex-temporal/src/change_time_unit.rs:53:9
replace <impl fmt::Display for ChangeTimeUnitOptions>::fmt -> fmt::Result with Ok(Default::default())
--- vortex-extensions/vortex-temporal/src/change_time_unit.rs
+++ replace <impl fmt::Display for ChangeTimeUnitOptions>::fmt -> fmt::Result with Ok(Default::default())
@@ -45,17 +45,17 @@
/// The target unit, which must differ from the input unit.
pub unit: TimeUnit,
/// How to round a count when the target unit is coarser.
pub rounding: TemporalRounding,
}
impl fmt::Display for ChangeTimeUnitOptions {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "unit={}, rounding={}", self.unit, self.rounding)
+ Ok(Default::default()) /* ~ changed by cargo-mutants ~ */
}
}
/// Convert a [`Date`], [`Time`], [`Timestamp`], or [`Duration`] to another unit.
///
/// See [`change_time_unit`](crate::expr::change_time_unit) for the contract.
#[derive(Clone)]
pub struct ChangeTimeUnit;
cargo mutants -f vortex-extensions/vortex-temporal/src/change_time_unit.rs -F ':53:9:'
vortex-extensions/vortex-temporal/src/change_time_unit.rs:170:34
replace < with <= in <impl ScalarFnVTable for ChangeTimeUnit>::execute
--- vortex-extensions/vortex-temporal/src/change_time_unit.rs
+++ replace < with <= in <impl ScalarFnVTable for ChangeTimeUnit>::execute
@@ -162,17 +162,17 @@
.as_extension_opt()
.and_then(|ext| ext.metadata_opt::<AnyTemporal>())
.vortex_expect("`return_dtype` above accepts only temporal inputs");
let is_time = matches!(metadata, TemporalMetadata::Time(_));
let source_unit = metadata.time_unit();
let ChangeTimeUnitOptions { unit, rounding } = *options;
let source_nanos = source_unit.nanos_per_unit();
let target_nanos = unit.nanos_per_unit();
- let finer = target_nanos < source_nanos;
+ let finer = target_nanos <= /* ~ changed by cargo-mutants ~ */ source_nanos;
let factor = if finer {
source_nanos / target_nanos
} else {
target_nanos / source_nanos
};
let convert = |value: i64| {
if finer {
value.checked_mul(factor).ok_or_else(|| {
cargo mutants -f vortex-extensions/vortex-temporal/src/change_time_unit.rs -F ':170:34:'
vortex-extensions/vortex-temporal/src/change_time_unit.rs:203:9
replace <impl ScalarFnVTable for ChangeTimeUnit>::is_strict -> bool with false
--- vortex-extensions/vortex-temporal/src/change_time_unit.rs
+++ replace <impl ScalarFnVTable for ChangeTimeUnit>::is_strict -> bool with false
@@ -195,17 +195,17 @@
Ok(result)
});
}
map_counts(input, &target, ctx, convert)
}
fn is_strict(&self, _options: &Self::Options) -> bool {
- true
+ false /* ~ changed by cargo-mutants ~ */
}
}
#[cfg(test)]
mod tests {
use std::sync::Arc;
use hegel::TestCase;
cargo mutants -f vortex-extensions/vortex-temporal/src/change_time_unit.rs -F ':203:9:'
vortex-extensions/vortex-temporal/src/date_to_timestamp.rs:43:9
replace <impl fmt::Display for DateToTimestampOptions>::fmt -> fmt::Result with Ok(Default::default())
--- vortex-extensions/vortex-temporal/src/date_to_timestamp.rs
+++ replace <impl fmt::Display for DateToTimestampOptions>::fmt -> fmt::Result with Ok(Default::default())
@@ -35,17 +35,17 @@
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct DateToTimestampOptions {
/// The unit of the target timestamp.
pub unit: TimeUnit,
}
impl fmt::Display for DateToTimestampOptions {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "unit={}", self.unit)
+ Ok(Default::default()) /* ~ changed by cargo-mutants ~ */
}
}
/// Convert a [`Date`](crate::datetime::Date) to an unzoned [`Timestamp`] at the start of the day.
///
/// See [`date_to_timestamp`](crate::expr::date_to_timestamp) for the contract.
#[derive(Clone)]
pub struct DateToTimestamp;
cargo mutants -f vortex-extensions/vortex-temporal/src/date_to_timestamp.rs -F ':43:9:'
vortex-extensions/vortex-temporal/src/hegel.rs:108:5
replace nullable_values -> (Vec<Option<T>>, Nullability) with (vec![], Default::default())
--- vortex-extensions/vortex-temporal/src/hegel.rs
+++ replace nullable_values -> (Vec<Option<T>>, Nullability) with (vec![], Default::default())
@@ -100,19 +100,10 @@
element: F,
max_size: usize,
) -> (Vec<Option<T>>, Nullability)
where
T: Debug + Send + Sync + 'static,
G: Generator<T> + Send + Sync + 'static,
F: Fn() -> G + Send + Sync + 'static,
{
- let nullability = tc.draw(gs::default::<Nullability>());
- let values = match nullability {
- Nullability::NonNullable => tc
- .draw(gs::vecs(element()).max_size(max_size))
- .into_iter()
- .map(Some)
- .collect(),
- Nullability::Nullable => tc.draw(gs::vecs(gs::optional(element())).max_size(max_size)),
- };
- (values, nullability)
+ (vec![], Default::default()) /* ~ changed by cargo-mutants ~ */
}
cargo mutants -f vortex-extensions/vortex-temporal/src/hegel.rs -F ':108:5:'
- Ngôn ngữ chính
- Rust
- Star
- 3.2k
- Fork
- 239
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 684
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vortex-data/vortex
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vortex-data/vortex#12633 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
vortex-data/vortex#12628 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
vortex-data/vortex#12491 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fallible constructor for nested_case_whenCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vortex-data/vortex#11425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
vortex-data/vortex#12634 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vortex-data/vortex
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
marklauter/tsong#110 ·
-
docs enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: engine bug needs milestone
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Mudcrab-Team/mudcrab#1197 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày