Add comprehensive test coverage (91 → 444 tests)#4
Merged
Conversation
New tests added: - End-to-end pipeline tests for all models (MarketAdjusted, ComparisonPeriodMeanAdjusted, BHAR, Volatility, FF3, FF5, Carhart) - Functional tests for BMPTest, PatellZTest, CalendarTimePortfolioTest - Plot function tests (plot_event_study, plot_diagnostics, plot_stocks) - Validation edge cases (insufficient estimation obs, window overlap, thin trading, time series gaps) - Diagnostics edge cases (pretrend_test filtering, value ranges) - Return calculation edge cases (custom columns, log/simple agreement) - Cross-sectional regression (ANOVA path, single group, car_window, non-matching event_ids) - Export content validation (read back CSV, verify columns) - Tidy edge cases (non-regression models, missing stat_name) Also fixes bare tibble() calls in test helpers to use tibble::tibble() for reliable namespace resolution under devtools::test(). Refs #3 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Tests cover: single-event multi-event stats, NA propagation, zero-variance returns, division-by-zero in forecast error correction, constant AARs, zero/negative prices, single-day event windows, empty event windows, BHARTTest NA coalesce, task accessor error paths, ParameterSet with null stats, and validation edge cases. Full suite now at 504 tests. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Owner
Author
Added: 60 edge case testsNew file
Also documents a known bug: Full test suite: 504 tests, 0 failures, 0 warnings. |
Set up R-CMD-check on Ubuntu/macOS/Windows (R release + devel) and a separate coverage job using covr + Codecov. Add R-CMD-check and Codecov badges to README. Add covr to Suggests. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
tibble()calls in test helpers to usetibble::tibble()for reliable namespace resolution underdevtools::test()create_mock_task_with_factors()andcreate_fitted_mock_task()test helpersNew test coverage by area:
test_execute.Rtest_multi_event_statistics.Rtest_plotting.R(new)test_validation.Rtest_diagnostics.Rtest_return_calculation.Rtest_cross_sectional.Rtest_export.Rtest_export.RRefs #3
Test plan
devtools::test()passes: 444 tests, 0 failures, 0 warnings🤖 Generated with Claude Code