Skip to content

🧪 Add unit tests for DomainSeparationTag in forge-ec-core#30

Open
tanm-sys wants to merge 1 commit into
mainfrom
jules-1681398144214152094-abfc1011
Open

🧪 Add unit tests for DomainSeparationTag in forge-ec-core#30
tanm-sys wants to merge 1 commit into
mainfrom
jules-1681398144214152094-abfc1011

Conversation

@tanm-sys

Copy link
Copy Markdown
Owner

🎯 What: Added missing unit tests for DomainSeparationTag::new and DomainSeparationTag::as_bytes in forge-ec-core/src/lib.rs.
📊 Coverage: Tests cover the basic instantiation logic to ensure suite_id and dst fields are set properly, and check if as_bytes generates correct concatenated byte string.
Result: The new tests successfully improve test coverage for basic configuration in forge-ec-core.


PR created automatically by Jules for task 1681398144214152094 started by @tanm-sys

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@tanm-sys has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 45 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: af6b57d2-a95a-49e7-afd3-08d0e151ae46

📥 Commits

Reviewing files that changed from the base of the PR and between 8ef8a1a and ddae5fb.

📒 Files selected for processing (1)
  • forge-ec-core/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-1681398144214152094-abfc1011

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread forge-ec-core/src/lib.rs
}
}

#[cfg(test)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CRITICAL: Missing #[cfg(feature = "alloc")] feature gate on test module

The DomainSeparationTag struct and its new() and as_bytes() methods are defined behind #[cfg(feature = "alloc")]. Without the same feature gate, these tests will fail to compile when building without the alloc feature.

#[cfg(test)]
#[cfg(feature = "alloc")]
mod tests {
    use super::*;

    #[test]
    fn test_domain_separation_tag_new() {
        let dst = DomainSeparationTag::new("suite_id_test", "dst_test");
        assert_eq!(dst.suite_id, "suite_id_test");
        assert_eq!(dst.dst, "dst_test");
    }

    #[test]
    fn test_domain_separation_tag_as_bytes() {
        let dst = DomainSeparationTag::new("suite", "tag");
        let bytes = dst.as_bytes();
        assert_eq!(bytes, b"suitetag");
    }
}

Note: When both #[cfg(test)] and #[cfg(feature = "alloc")] are applied to the same module, use #[cfg(all(test, feature = "alloc"))] or place #[cfg(feature = "alloc")] inside the module.

@kilo-code-bot

kilo-code-bot Bot commented May 21, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
Issue Details (click to expand)

CRITICAL

File Line Issue
forge-ec-core/src/lib.rs 1889 Missing #[cfg(feature = "alloc")] feature gate on test module. The DomainSeparationTag struct is gated behind this feature, so tests will fail to compile without it.
Files Reviewed (1 file)
  • forge-ec-core/src/lib.rs - 1 issue

Reviewed by laguna-m.1-20260312:free · 931,562 tokens

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