Skip to content

Add Unit Test project#34

Merged
Lyrcaxis merged 2 commits into
Lyrcaxis:mainfrom
PhilippNaused:unit-tests
Jun 9, 2025
Merged

Add Unit Test project#34
Lyrcaxis merged 2 commits into
Lyrcaxis:mainfrom
PhilippNaused:unit-tests

Conversation

@PhilippNaused

Copy link
Copy Markdown
Contributor

@Lyrcaxis, you said you weren't particular about the choice of framework, so I used TUnit.

@PhilippNaused PhilippNaused marked this pull request as ready for review June 8, 2025 19:03
@PhilippNaused PhilippNaused force-pushed the unit-tests branch 2 times, most recently from 632649a to ce14269 Compare June 9, 2025 14:48
@Lyrcaxis Lyrcaxis requested a review from Copilot June 9, 2025 16:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds a new unit test project using TUnit for testing the Tokenizer functionality. It also adjusts the PreprocessText method by providing a default parameter for langCode and updates project configuration files accordingly.

  • Added default parameter "en-us" to PreprocessText method.
  • Configured InternalsVisibleTo in the main project to support unit testing.
  • Introduced a new test project with several Tokenizer tests and a CI workflow for building and testing.

Reviewed Changes

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

Show a summary per file
File Description
KokoroSharp/Processing/Tokenizer.cs Updated PreprocessText with a default parameter for langCode
KokoroSharp/KokoroSharp.csproj Added InternalsVisibleTo for unit testing
KokoroSharp.sln Included the new KokoroSharp.Tests project in the solution
KokoroSharp.Tests/TokenizerTests.cs New test file for Tokenizer with various test cases
KokoroSharp.Tests/KokoroSharp.Tests.csproj New project file for unit tests using TUnit
.github/workflows/tests.yml New GitHub Actions workflow configuration for build & test
Comments suppressed due to low confidence (2)

KokoroSharp/Processing/Tokenizer.cs:84

  • Update the XML documentation for PreprocessText to mention the default value for langCode and any related behavior.
internal static string PreprocessText(string text, string langCode = "en-us") {

KokoroSharp.Tests/TokenizerTests.cs:3

  • The namespace 'Kokoro.Tests' does not match the project name 'KokoroSharp.Tests'. Consider renaming it for consistency.
namespace Kokoro.Tests;

Comment thread KokoroSharp.Tests/TokenizerTests.cs Outdated

@Lyrcaxis Lyrcaxis left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice, let's test!

@Lyrcaxis Lyrcaxis merged commit 7a34916 into Lyrcaxis:main Jun 9, 2025
1 check passed
@PhilippNaused PhilippNaused deleted the unit-tests branch June 9, 2025 16:49
PhilippNaused added a commit to PhilippNaused/KokoroSharp that referenced this pull request Jun 9, 2025
* Add test project

* Add tests for text pre-processor
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.

3 participants