artichoke / strftime-ruby

⏳ Ruby `Time#strftime` parser and formatter
https://crates.io/crates/strftime-ruby
MIT License
12 stars 0 forks source link

Improve tests found by cargo-mutants #149

Closed x-hgg-x closed 5 days ago

x-hgg-x commented 6 days ago

Output of the last version of cargo-mutants for this crate:

MISSED   src/format/mod.rs:513:41: replace % with / in Piece::fmt in 0.3s build + 0.5s test
MISSED   src/format/mod.rs:117:16: replace |= with ^= in Flags::set in 0.2s build + 0.5s test
MISSED   src/format/mod.rs:652:50: replace < with == in Piece::fmt in 0.3s build + 0.5s test
TIMEOUT  src/format/utils.rs:26:9: replace Cursor<'a>::next -> Option<u8> with Some(0) in 0.2s build + 20.0s test
TIMEOUT  src/format/mod.rs:911:13: replace /= with %= in year_width in 0.2s build + 20.0s test
TIMEOUT  src/format/utils.rs:26:9: replace Cursor<'a>::next -> Option<u8> with Some(1) in 0.2s build + 20.0s test
MISSED   src/format/mod.rs:123:44: replace | with ^ in Flags::has_change_or_upper_case in 0.2s build + 0.5s test
MISSED   src/format/mod.rs:508:41: replace % with / in Piece::fmt in 0.2s build + 0.5s test
MISSED   src/format/mod.rs:684:50: replace < with == in Piece::fmt in 0.3s build + 0.5s test
MISSED   src/format/mod.rs:96:21: replace << with >> in 0.3s build + 0.5s test

This PR improves tests to catch these potential bugs. The main code is still correct and has not changed.