Split monolithic r2f tests into focused files - #43
Merged
t-kalinowski merged 5 commits intoAug 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the monolithic test-r2f.R file into focused, logically grouped unit test files to improve test organization and maintainability.
- Splits the large
test-r2f.Rfile into 15 specialized test files organized by functionality - Creates example test files demonstrating real-world algorithms (Viterbi, heat diffusion, convolution, rolling mean)
- Moves related snapshot files alongside their new test files
Reviewed Changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-r2f.R | Removes original monolithic test file (1134 lines deleted) |
| tests/testthat/test-add.R | Addition operations and basic function translation tests |
| tests/testthat/test-which.R | Tests for which.max and which.min functions |
| tests/testthat/test-unary-intrinsics.R | Tests for mathematical intrinsic functions (sin, cos, abs, etc.) |
| tests/testthat/test-size-constraint.R | Tests for array size constraint validation |
| tests/testthat/test-seq.R | Tests for sequence generation |
| tests/testthat/test-matrix.R | Matrix creation and implicit size reuse tests |
| tests/testthat/test-loops.R | Loop construct tests (repeat, while, for, break, next) |
| tests/testthat/test-logical.R | Logical operations and comparisons |
| tests/testthat/test-ifelse.R | Conditional ifelse operation tests |
| tests/testthat/test-hoist-mask.R | Mask hoisting optimization tests |
| tests/testthat/test-div-mod.R | Modulus and integer division operator tests |
| tests/testthat/test-declare-type.R | Type declaration syntax variant tests |
| tests/testthat/test-example-*.R | Real-world algorithm examples (Viterbi, heat diffusion, convolution, rolling mean) |
| tests/testthat/_snaps/*.md | Snapshot files moved to match new test structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
Summary
test-r2f.Rinto logically grouped unit test filesTesting
R -q -e "testthat::test_local()"https://chatgpt.com/codex/tasks/task_e_68a8f135592c8332a10e27ed0ef565a9