🧪 Add tests for StructuredAnswer.citationIndex extraction#29
Conversation
Co-authored-by: Gunnarguy <110250624+Gunnarguy@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's GuideAdds focused unit tests for StructuredAnswer.citationIndex(from:) and relaxes its visibility from private to internal to enable testing, improving coverage of inline citation parsing behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fc29b18e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,32 @@ | |||
| import XCTest | |||
| @testable import OpenIntelligence | |||
There was a problem hiding this comment.
Import the package module in the new test
In the SwiftPM test target, OpenIntelligenceTests depends on the OpenIntelligenceEngine product defined in Package.swift, and the existing tests all use @testable import OpenIntelligenceEngine. This new file imports OpenIntelligence, which is the app target name rather than a package dependency, so running the package tests will fail with no such module 'OpenIntelligence' before these assertions execute. Use @testable import OpenIntelligenceEngine here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR adds unit tests for StructuredAnswer.citationIndex(from:) (the inline citation index parser) and relaxes the helper’s visibility from private to internal so it can be exercised via @testable import.
Changes:
- Add
StructuredAnswerTestscovering valid, invalid, and mixed-text citation inputs. - Change
StructuredAnswer.citationIndex(from:)visibility fromprivatetointernalfor test access.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| OpenIntelligenceTests/Core/Models/StructuredAnswerTests.swift | New unit tests validating citationIndex(from:) parsing behavior across multiple input shapes. |
| OpenIntelligence/Core/Models/StructuredAnswer.swift | Exposes citationIndex(from:) as internal so tests can call it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import XCTest | ||
| @testable import OpenIntelligence |
🎯 What: Added tests for the
citationIndex(from:)parsing logic insideStructuredAnswer.swift. This covers the previous testing gap for this utility function.📊 Coverage: Covered valid scenarios (like "S1", "s2", "[S3]"), invalid scenarios (empty strings, "S", "S0"), and handling text containing multiple elements. Modified visibility of
citationIndexfromprivatetointernalso it can be accessed via@testable import.✨ Result: Enhanced test coverage ensures the stability and reliability of inline citation extraction when formatting StructuredAnswers.
PR created automatically by Jules for task 14510794647580699205 started by @Gunnarguy
Summary by Sourcery
Add unit test coverage for StructuredAnswer inline citation index parsing and expose the helper for testing.
Enhancements:
Tests: