Skip to content

Develop#17

Merged
lefticus merged 62 commits intomainfrom
develop
Mar 26, 2026
Merged

Develop#17
lefticus merged 62 commits intomainfrom
develop

Conversation

@lefticus
Copy link
Owner

No description provided.

* Tests added by claude
* some fail related to working with literal lists
* Make sure lists are reused when possible
* added a new "symbol" type to avoid conflation with identifiers
* Add new "quote" function
* New lists_tests added and car/cdr fixes in place
* Add claude generated parser tests
* Add CLAUDE.md
* Simplify parser test suite
* allow lambda in a define to see outer scope so it can find itself
* stop fixing up all closure statements at execution time
* add tests proving recursion is working as expected
* coverage reporting target also added
* this will never be supported
* gets us to 98.8% code coverage
* ' are translated into (quote ) blocks
* literals are quoted when desired
* add many more tests
* fix scoping of closures
* register name with closure
lefticus and others added 28 commits May 21, 2025 19:50
Add comprehensive instructions for running branch coverage reports using
the pre-configured build-coverage directory and gcovr tool. Includes specific
commands, required flags, and notes about handling dependency errors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add SmallVector overflow scenarios in constexpr_tests.cpp
- Add missing number parsing edge cases in parser_tests.cpp
- Add string escape error conditions in string_escape_tests.cpp
- Focus on untested branches without duplicating existing functionality
- Increase branch coverage from 36% to 35% (745/2095 branches)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…se tests

- Add 6 new test categories targeting uncovered branches in cons_expr library
- Cover Scratch class move semantics, closure self-reference, and list bounds checking
- Test complex parsing edge cases, malformed expressions, and function invocation errors
- Validate advanced error handling, nested error propagation, and type mismatches
- Increase total test count from 297 to 309 tests with all tests passing
- Improve validation of parser robustness, memory management, and type safety

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…o 36%

Added 6 new test cases with multiple sub-tests each targeting previously uncovered code paths:
- Number parsing edge cases and arithmetic operations
- Conditional expression and control flow coverage
- Template specialization and type handling coverage
- Advanced list operations and memory management
- Parser token handling and quote processing
- SmallVector overflow and mathematical operations

All 320 tests pass in both constexpr and runtime modes, ensuring correctness at compile-time and runtime.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…red branches

Added 4 comprehensive test cases with systematic targeting of specific uncovered code paths:
- Error path coverage targeting lines 263 (number parsing failures) and 860-868 (function invocation errors)
- Parser edge cases and malformed input coverage (unterminated strings, unmatched parentheses, comment handling)
- Type conversion and mathematical edge cases (type mismatch errors, floating point precision)
- Advanced control flow and scope edge cases (nested scopes, lambda parameter validation, complex cond expressions)

Increased branch coverage from 742 to 758 taken branches (+16 branches). All 329 tests pass in both constexpr and runtime modes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Previously, car returned an error for empty lists while cdr returned
an empty list. This inconsistency has been fixed to follow Scheme
standards where both operations are errors on empty lists.

- Update cdr to return error "cdr: cannot take cdr of empty list"
- Add comprehensive tests for car/cdr error handling
- Update existing tests that expected the old cdr behavior
- Add documentation comments noting the error behavior

This is a breaking change for code that relied on (cdr '()) returning '().

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
* it's possible to hit a long-running or infinite loop
* this does not indicate a bug in the code
* but will show up as a random test failure
Add examples for how it's used
* Add failing tests for container overflow error propagation

Tests verify that SmallVector container overflows (values, strings,
object_scratch) return Error SExprs instead of silently corrupting data.
Currently these tests crash/fail, proving the need for error propagation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Propagate SmallVector container overflow errors to callers

Add has_container_error() and make_container_error() to detect and report
when any SmallVector container enters error state. Check for overflow in
evaluate(), sequence(), and parse() so errors bubble up as Error SExprs
instead of causing silent data corruption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add specific error messages for each container overflow type

Distinguish between strings, values, scratch, and scope container
overflows so callers can identify which resource was exhausted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add error handling tests for propagation, arg counts, and evaluate_to

Test error propagation through nested expressions, if branches, let
bindings/body, cond results, begin, and eval. Test wrong arg counts for
error?, quote, if, and cons. Test that evaluate_to surfaces errors via
std::expected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Simplify parse_number from state machine to sequential phase processing

Replace the 5-state switch-based parser with sequential digit consumption
phases (sign, integer, fraction, exponent). Same functionality in roughly
35% less code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Extract to_quoted/from_quoted helpers to DRY up car, cons, and quote

The nested get_if chains for converting between quoted representations
(list_type↔literal_list_type, identifier↔symbol) were repeated in car,
cons, and quote. Extract into two inverse helper functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Replace hand-rolled error_p with make_type_predicate<error_type>()

error_p was doing exactly what the generic make_type_predicate already
does: check param count, eval, check type, return bool. Eliminate the
dedicated function and reuse the existing template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🎨 Committing clang-format changes

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Clang Robot <robot@example.com>
@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 59.57728% with 918 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.02%. Comparing base (921ef78) to head (042f2e0).
⚠️ Report is 63 commits behind head on main.

Files with missing lines Patch % Lines
test/constexpr_tests.cpp 61.34% 4 Missing and 410 partials ⚠️
test/parser_tests.cpp 69.41% 1 Missing and 114 partials ⚠️
test/list_tests.cpp 25.53% 0 Missing and 70 partials ⚠️
test/error_handling_tests.cpp 49.12% 0 Missing and 58 partials ⚠️
include/cons_expr/cons_expr.hpp 81.06% 7 Missing and 39 partials ⚠️
test/type_predicate_tests.cpp 20.00% 0 Missing and 40 partials ⚠️
test/scoping_tests.cpp 44.61% 0 Missing and 36 partials ⚠️
src/cons_expr_cli/main.cpp 23.07% 12 Missing and 18 partials ⚠️
test/list_construction_tests.cpp 40.81% 0 Missing and 29 partials ⚠️
test/string_escape_tests.cpp 56.36% 0 Missing and 24 partials ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff            @@
##           main      #17       +/-   ##
=========================================
+ Coverage      0   61.02%   +61.02%     
=========================================
  Files         0       19       +19     
  Lines         0     3092     +3092     
  Branches      0     1815     +1815     
=========================================
+ Hits          0     1887     +1887     
- Misses        0      184      +184     
- Partials      0     1021     +1021     
Flag Coverage Δ
Linux 61.02% <59.57%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lefticus lefticus merged commit a71e071 into main Mar 26, 2026
21 checks passed
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.

1 participant