Skip to content

Conversation

@hiqua
Copy link
Owner

@hiqua hiqua commented Jun 25, 2025

No description provided.

This commit introduces QuickCheck tests for several key functions:
- `get_life_chunk` in `src/parse.rs`: Tests properties like non-negative duration and category format. The `prop_input_reconstruction` test has been commented out due to difficulties in handling arbitrary string generation and parsing nuances for the `.input` field.
- `are_compatible` in `src/merge.rs` (test-local helper): Tests compatibility logic for intervals.
- `merge_strictly_compatible_lifelapses` in `src/merge.rs`: Tests properties related to merging contiguous LifeLapse objects, including duration preservation and token presence.

Necessary `Arbitrary` implementations for various types (including newtype wrappers for `chrono::DateTime<Local>` and `time::Duration` to satisfy orphan rules) have been added. Several minor bugs and warnings discovered during the process were also fixed. System dependency `libdbus-1-dev` was identified and added to the environment for successful compilation.
This commit introduces QuickCheck tests for several key functions within the existing test modules:
- `get_life_chunk` in `src/parse.rs`: Tests properties like non-negative duration and category format. The `prop_input_reconstruction` test has been commented out due to difficulties in handling arbitrary string generation and parsing nuances for the `.input` field.
- `are_compatible` in `src/merge.rs` (test-local helper): Tests compatibility logic for intervals.
- `merge_strictly_compatible_lifelapses` in `src/merge.rs`: Tests properties related to merging contiguous LifeLapse objects, including duration preservation and token presence.

The QuickCheck dependencies (`quickcheck` and `quickcheck_macros`) were added to `Cargo.toml` under `[dev-dependencies]`.

Necessary `Arbitrary` implementations for various types (including newtype wrappers for `chrono::DateTime<Local>` and `time::Duration` to satisfy orphan rules within test code) have been added. Several minor bugs and warnings in the test code, discovered during the process, were also fixed. No production code was changed.
Adds QuickCheck dependencies and property-based tests for various
functions in `parse.rs` and `summary.rs`.

Implemented Arbitrary for Quadrant, LifeChunk, and TimedLifeChunk
to facilitate test data generation.

As per user instruction, three initially added tests that were failing
due to subtle interactions with formatting or special input handling
(quadrant strings as categories) were removed to ensure all committed
tests pass:
- prop_parse_date_valid_ymd_hm
- prop_parse_date_valid_ymd_hhm
- prop_get_life_chunk_categories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants