Skip to content

Add tests for singlefile bundles with non-ascii characters#118281

Merged
jtschuster merged 6 commits intodotnet:mainfrom
jtschuster:HostWriterChineseChar
Aug 5, 2025
Merged

Add tests for singlefile bundles with non-ascii characters#118281
jtschuster merged 6 commits intodotnet:mainfrom
jtschuster:HostWriterChineseChar

Conversation

@jtschuster
Copy link
Copy Markdown
Member

Adds tests for bundles that contain non-ascii characters to validate all strings in a singlefile bundle are written as UTF-8.

Fixes #118098

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 1, 2025
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

This PR adds comprehensive test coverage for singlefile bundles containing non-ASCII characters to ensure proper UTF-8 encoding throughout the bundling process. The change addresses issue #118098 by validating that the bundler correctly handles Unicode strings in file paths and bundle metadata.

  • Creates a new test project HelloWorld_中文 with Chinese characters to verify Unicode support
  • Adds unit tests to validate bundling operations with non-ASCII file paths and names
  • Extends integration tests to verify end-to-end functionality of bundles with special characters

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

File Description
BundlerConsistencyTests.cs Adds unit test for bundling files with non-ASCII characters in relative paths
AppLaunch.cs Adds integration test for launching self-contained apps with non-ASCII names
HelloWorld_中文/*.cs New test project files with Unicode characters in project name
HelloWorld_中文/*.csproj Project configuration files for the Unicode test project
Comments suppressed due to low confidence (1)

src/installer/tests/Microsoft.NET.HostModel.Tests/Bundle/BundlerConsistencyTests.cs:135

  • The test creates a bundle but doesn't verify that the bundle was created successfully or validate any properties of the generated bundle. Consider adding assertions to verify the bundle generation succeeded and that the non-ASCII characters are preserved correctly.
            var bundlePath = bundler.GenerateBundle(fileSpecs);

Comment thread src/installer/tests/AppHost.Bundle.Tests/AppLaunch.cs Outdated
@teo-tsirpanis teo-tsirpanis added area-Single-File and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 3, 2025
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov
See info in area-owners.md if you want to be subscribed.

Comment thread src/installer/tests/Assets/Projects/HelloWorld_中文/SelfContained.csproj Outdated
Comment thread src/installer/tests/Assets/Projects/HelloWorld_中文/HelloWorld_中文.csproj Outdated
@jtschuster jtschuster merged commit 34574d7 into dotnet:main Aug 5, 2025
72 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET bundle may be built with non-utf8 but always execute with utf8.

4 participants