feat: Add 66 new unit tests for error types, overlap cases, GTF parsing, and rules#12
Closed
TianYuan-Liu wants to merge 2 commits intomasterfrom
Closed
feat: Add 66 new unit tests for error types, overlap cases, GTF parsing, and rules#12TianYuan-Liu wants to merge 2 commits intomasterfrom
TianYuan-Liu wants to merge 2 commits intomasterfrom
Conversation
…ng, and rules Add comprehensive test coverage across multiple modules: Error Types (9 tests): Display and Error trait implementations for ParseStrandError, ParseAreaError, ParseReportLevelError, plus Clone implementations for all error types. match_region_to_genes Overlap Cases (12 tests): Exhaustive coverage of exon/region spatial relationships including exon before region, partial overlaps (left/right), exon inside region, region inside exon, upstream regions, negative strand handling, TSS/TTS checking, and multi-transcript scenarios. GtfData Struct (7 tests): max_lengths calculation, multiple genes and chromosomes, clone implementation, exon-only GTF files, invalid strand skipping, and custom gene/transcript tags. BedReader Edge Cases (9 tests): Very long lines, special chromosome names, zero and large coordinates, metadata with special characters, chunk boundary handling, whitespace in metadata, and negative coordinates. Config Default Rules (4 tests): DEFAULT_RULES order and length verification, Config rules matching defaults, and tag defaults. match_regions_to_genes Integration (4 tests): Empty input/genes handling, multiple sorted regions, and max_gene_length usage. TSS/TTS Boundaries (9 tests): Exact boundary conditions, zero values, very large values, and negative strand coordinate handling. apply_rules Edge Cases (5 tests): Same area different percentages, empty rules fallback, pctg thresholds, multiple independent groups, and order preservation. select_transcript Edge Cases (4 tests): Merge max percentages, different areas priority, fallback behavior, and merged transcript IDs. Output Formatting (5 tests): Varying meta columns, all areas output, decimal precision, region ID format, and midpoint calculation. Total test count increased from 282 to 348 tests.
Run cargo fmt to fix line length and indentation issues detected by CI. Co-Authored-By: Claude (claude-opus-4-5) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Error Types (9 tests): Display and Error trait implementations for
ParseStrandError, ParseAreaError, ParseReportLevelError, plus Clone
implementations for all error types.
match_region_to_genes Overlap Cases (12 tests): Exhaustive coverage of
exon/region spatial relationships including exon before region, partial
overlaps (left/right), exon inside region, region inside exon, upstream
regions, negative strand handling, TSS/TTS checking, and multi-transcript
scenarios.
GtfData Struct (7 tests): max_lengths calculation, multiple genes and
chromosomes, clone implementation, exon-only GTF files, invalid strand
skipping, and custom gene/transcript tags.
BedReader Edge Cases (9 tests): Very long lines, special chromosome names,
zero and large coordinates, metadata with special characters, chunk
boundary handling, whitespace in metadata, and negative coordinates.
Config Default Rules (4 tests): DEFAULT_RULES order and length
verification, Config rules matching defaults, and tag defaults.
match_regions_to_genes Integration (4 tests): Empty input/genes handling,
multiple sorted regions, and max_gene_length usage.
TSS/TTS Boundaries (9 tests): Exact boundary conditions, zero values,
very large values, and negative strand coordinate handling.
apply_rules Edge Cases (5 tests): Same area different percentages, empty
rules fallback, pctg thresholds, multiple independent groups, and order
preservation.
select_transcript Edge Cases (4 tests): Merge max percentages, different
areas priority, fallback behavior, and merged transcript IDs.
Output Formatting (5 tests): Varying meta columns, all areas output,
decimal precision, region ID format, and midpoint calculation.
Total test count increased from 282 to 348 tests.