Skip to content

Test that a hand-edited Windows install ID file is kept as is - #23

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/test-hand-edited-install-id-file
Oct 31, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/test-hand-edited-install-id-file

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • Adds InstallIdFromFile_KeepsAHandEditedWindowsFileAsIs (Theory: UTF-8, UTF-8 with BOM, UTF-16) to tests/TraceClient.Tests/InstallIdTest.cs.
  • The README says of the install ID file "Or put your own value in it." A file saved by Notepad has CRLF line endings, may start with a byte order mark, or may be UTF-16 outright. No existing test covered those shapes. The new test pins the current behaviour: the ID is read (trimmed of the trailing space and \r) and the file's bytes are left untouched.
  • Characterization only (Stage B: unit-test expansion). No production code changes.

No tracking issue: the gap was found during triage.

Deferred

Test plan

  • Build workflow green on ubuntu-latest (net8.0)
  • Build workflow green on windows-latest (net8.0 + net48); the new Theory runs 3 cases per target framework
  • Local run: UNVERIFIED. No dotnet SDK is available in the dispatch sandbox, so the CI matrix on the PR head is the gate.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

The README invites putting one's own value in the install ID file. A file
saved by Notepad has CRLF line endings and may carry a UTF-8 byte order
mark or be UTF-16; the ID in it must be read and the file left untouched.

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

dmccoystephenson commented Oct 31, 2026 •

Copy link
Copy Markdown
Member Author

Self-review rubric (CI-anchored; posted as a plain comment, not as an independent review):

  • Scope: PASS — the diff touches only tests/TraceClient.Tests/InstallIdTest.cs (+23 lines: one using System.Text; and one Theory). No production code, csproj, workflow or README change.
  • Tests-new: PASS (not applicable) — no new public member. The new test exercises the existing InstallIdFromFile.
  • Tests-fix: not applicable — this is characterization, not a bug fix. The test asserts current behaviour and was not written to fail first.
  • Sibling structure: PASS — no new file. The Theory sits next to InstallIdFromFile_KeepsALineExactlyAtTheLimit and follows the file's Subject_BehaviourInPlainWords naming, _directory fixture and "not replaced" byte-comparison idiom.
  • Sibling renames: not applicable — nothing renamed.
  • Docs: PASS — no behaviour changed. The test backs the README's existing "Or put your own value in it" wording, and the InstallIdFromFile XML doc already describes the first-valid-line rule the test relies on (trimmed, then matched).
  • Issue resolution: not applicable — no Closes. The PR body records that no tracking issue exists and why Non-ASCII application name drops every report on .NET 5+ (User-Agent header) #12 was deferred.
  • CI: PASS — run 41155527364 is green on both legs. Totals went from 91 on main (run 40986052712) to 94 on net8.0 (ubuntu), net8.0 (windows) and net48 (windows), so all three new cases ran on every target framework.
  • No dependencies / Single file / Vendoring floor / Never throws / Non-blocking / Environment seam / Version / Opt-out contract: PASS (unchanged) — src/ is untouched.

Observation outside the diff: the new test relies on File.ReadAllLines (src/TraceClient/TraceClient.cs:275) detecting byte order marks. It does on .NET Framework 4.8 and .NET 8, as this run confirms, but that has not been verified on Unity/Mono, which CI does not run.

Local run: UNVERIFIED (no dotnet SDK in the dispatch sandbox). The CI matrix on head 4515181 is the gate.

(Edited to correct an observation that wrongly cited an unrelated test.)

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 6d3b77a into main Oct 31, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/test-hand-edited-install-id-file branch October 31, 2026 01:30
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