Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Jan 19, 2026

Summary

  • Add unit tests for string.rs (first_line function)
  • Add unit tests for context.rs (ParsingContext creation and error building)
  • Add unit tests for helpers.rs (NodeHelper and ParseEntry KDL parsing)

These modules were previously untested. This PR adds 22 new tests covering:

  • String utility functions
  • Parsing context creation and error generation
  • KDL node parsing helpers including argument access, property access, child nodes, and type-safe value extraction

🤖 Generated with Claude Code


Note

Expands test coverage for previously untested modules to validate parsing and utility behaviors.

  • lib/src/spec/context.rs: tests ParsingContext::new, Default, and build_err error construction with SourceSpan
  • lib/src/spec/helpers.rs: tests NodeHelper (name, arg, args, props, get, children, ensure_arg_len) and ParseEntry type checks (ensure_usize, ensure_bool, ensure_string) including mismatch errors
  • lib/src/string.rs: tests first_line across single-line, multi-line, empty, newline-only, and CRLF inputs

Written by Cursor Bugbot for commit c4a5f73. This will update automatically on new commits. Configure here.

Add comprehensive unit tests for:
- string.rs: first_line function tests
- context.rs: ParsingContext creation and error building tests
- helpers.rs: NodeHelper and ParseEntry tests for KDL parsing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 19, 2026 19:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive unit test coverage for three previously untested utility modules in the codebase: string utilities, parsing context, and KDL parsing helpers.

Changes:

  • Added 5 tests for the first_line string utility function covering various edge cases
  • Added 3 tests for ParsingContext creation and error generation functionality
  • Added 14 tests for KDL node parsing helpers including argument access, property handling, and type-safe value extraction

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/src/string.rs Added unit tests for the first_line function covering single/multi-line strings, empty strings, and CRLF line endings
lib/src/spec/helpers.rs Added comprehensive tests for NodeHelper and ParseEntry KDL parsing functionality including argument/property access and type validation
lib/src/spec/context.rs Added tests for ParsingContext initialization (new/default) and error building capabilities

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 99.18699% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.56%. Comparing base (9df7c86) to head (c4a5f73).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/spec/context.rs 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #447      +/-   ##
==========================================
+ Coverage   47.36%   48.56%   +1.20%     
==========================================
  Files          47       47              
  Lines        6653     6776     +123     
  Branches     6653     6776     +123     
==========================================
+ Hits         3151     3291     +140     
+ Misses       1739     1722      -17     
  Partials     1763     1763              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdx jdx merged commit 3c1a9df into main Jan 19, 2026
11 checks passed
@jdx jdx deleted the feat/test-coverage branch January 19, 2026 19:26
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.

2 participants