Skip to content

Add char extensions: Repeat and AsString#40

Merged
Tyrrrz merged 1 commit intoprimefrom
copilot/add-char-extensions
Apr 17, 2026
Merged

Add char extensions: Repeat and AsString#40
Tyrrrz merged 1 commit intoprimefrom
copilot/add-char-extensions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

Ports the char extension methods from CliFx's StringExtensions into PowerKit.

Changes

  • PowerKit/Extensions/CharExtensions.cs — new file with two extension(char c) members:
    • Repeat(int count)new string(c, count)
    • AsString()c.Repeat(1)
  • PowerKit.Tests/CharExtensionsTests.cs — unit tests for both methods

Usage

'*'.Repeat(5)   // "*****"
'x'.AsString()  // "x"

Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/3d7e91f1-7f2c-4929-bcc5-2114454ddecf

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@Tyrrrz Tyrrrz added the enhancement New feature or request label Apr 17, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 17, 2026 06:53
Copilot AI review requested due to automatic review settings April 17, 2026 06:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.50%. Comparing base (667c235) to head (972c091).
⚠️ Report is 2 commits behind head on prime.

Additional details and impacted files
@@            Coverage Diff             @@
##            prime      #40      +/-   ##
==========================================
+ Coverage   94.47%   94.50%   +0.03%     
==========================================
  Files          76       78       +2     
  Lines        1574     1583       +9     
  Branches      131      131              
==========================================
+ Hits         1487     1496       +9     
  Misses         65       65              
  Partials       22       22              

☔ 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.

Copy link
Copy Markdown
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

Adds char extension helpers to PowerKit (ported from CliFx) to simplify generating strings from single characters and repeated characters.

Changes:

  • Introduces CharExtensions with Repeat(int count) and AsString().
  • Adds unit tests covering both new extension methods.

Reviewed changes

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

File Description
PowerKit/Extensions/CharExtensions.cs Adds char extensions for repeating a character into a string and converting a char to a single-character string.
PowerKit.Tests/CharExtensionsTests.cs Adds tests validating expected outputs for Repeat (including 0) and AsString.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants