Skip to content

Remove unused TempFile.FromResource(Stream) test helper - #174

Merged
imnasnainaec merged 2 commits into
masterfrom
remove-unused-tempfile-fromresource-stream
Oct 8, 2026
Merged

imnasnainaec merged 2 commits into
masterfrom
remove-unused-tempfile-fromresource-stream

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Split out of #165 (see this comment): with the net10.0 target, TempFile.FromResource(Stream, string) in L10NSharp.Tests triggers CA2022 (inexact Stream.Read).

Nothing in the solution calls this overload, and it was also subtly wrong: it sized the buffer resource.Length + 1 and wrote the whole buffer, so the file got a stray trailing 0x00 byte. Rather than fix it with a hand-written read loop (Stream.ReadExactly isn't available on net462/net48), this removes it.

The byte[] overload is also unused but triggers no warning, so it stays to keep this change minimal.

This change only touches the test project, so it needs no +semver marker or changelog entry.

🤖 Generated with Claude Code


This change is Reviewable

It ignored Stream.Read's return value (CA2022 on net10.0) and wrote a stray
trailing zero byte. Nothing calls it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Test Results

    7 files  ±0  154 suites  ±0   42s ⏱️ +13s
232 tests ±0  227 ✔️ ±0    5 💤 ±0  0 ❌ ±0 
896 runs  ±0  881 ✔️ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 2c24d28. ± Comparison against base commit caf2d3a.

♻️ This comment has been updated with latest results.

@imnasnainaec imnasnainaec self-assigned this Oct 8, 2026
@imnasnainaec
imnasnainaec marked this pull request as ready for review October 8, 2026 14:28
@imnasnainaec
imnasnainaec enabled auto-merge (squash) October 8, 2026 16:22
@imnasnainaec
imnasnainaec merged commit 715fc21 into master Oct 8, 2026
6 of 7 checks passed
@imnasnainaec
imnasnainaec deleted the remove-unused-tempfile-fromresource-stream branch October 8, 2026 16:25
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.

2 participants