test: add regression tests for list_swap, swap_columns, lu_factor#1954
Open
junhinhow wants to merge 3 commits intoBelfrySCAD:masterfrom
Open
test: add regression tests for list_swap, swap_columns, lu_factor#1954junhinhow wants to merge 3 commits intoBelfrySCAD:masterfrom
junhinhow wants to merge 3 commits intoBelfrySCAD:masterfrom
Conversation
Add test coverage for the list_swap() function (lists.scad) which was added in commit 42ad387 but had no corresponding test. Tests cover: - Basic swap of two elements by index - Swap with same index (no-op) - Swap with string elements - Swap first/last elements - Swap symmetry (i,j == j,i) - Swap with nested list elements This brings list_swap() into the regression test suite, improving overall coverage from 99.65% toward 100%. Ref: BelfrySCAD#231
Add test coverage for the swap_columns() function (linalg.scad) which was added in commit c461031 but had no corresponding test. Tests cover: - Swap non-adjacent columns in a 3x5 matrix - Swap first and last columns - Same-index swap (identity/no-op) - Swap on a 2x2 matrix - Swap on identity matrix produces permutation matrix Ref: BelfrySCAD#231
Add test coverage for the lu_factor() function (linalg.scad) which was added in commit 0678929 but had no corresponding test. Tests verify the LU decomposition property: select(A, perm) == transpose(LT) * U Cases covered: - 2x2 matrix: basic factorization and reconstruction - 3x3 matrix: non-trivial pivoting with reconstruction - Identity matrix: decomposition preserves identity This is the last uncovered public function in BOSL2, bringing test coverage to 855/855 (100%). Ref: BelfrySCAD#231
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
list_swap()with 7 asserts covering basic swaps, same-index, strings, and nested listsswap_columns()with 5 asserts covering 2x2, 3x3, and identity matriceslu_factor()with reconstruction verification for 2x2, 3x3, and identity matricesTest plan
func_coverage.pythat coverage is now 100%🤖 Generated with Claude Code