Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a-1
6 changes: 6 additions & 0 deletions src/Verify.Tests/Naming/NameForParameterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public Task StringEmpty() =>
public Task StringInvalidPathChar() =>
Verify(VerifierSettings.GetNameForParameter("a/a", counter: CounterBuilder.Empty()));

// `#` is reserved for the indexed-target namespace, so a value containing one
// would make this case's files look like the targets of the case without it
[Fact]
public Task StringHash() =>
Verify(VerifierSettings.GetNameForParameter("a#1", counter: CounterBuilder.Empty()));

[Fact]
public void CollectionItemPathFriendlyFalseNotCleaned()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x#1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x
9 changes: 9 additions & 0 deletions src/Verify.Tests/Naming/NamerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,15 @@ public Task ParametersWithBadPathChars(string value) =>
Verify(value)
.UseParameters(value);

// `{prefix}#` is the indexed-target namespace, so without cleaning the `x` case
// would claim the files of the `x#1` case
[Theory]
[InlineData("x")]
[InlineData("x#1")]
public Task ParametersWithHash(string value) =>
Verify(value)
.UseParameters(value);

[Fact]
public Task SingleTarget() =>
Verify([new Target("txt", "data")]);
Expand Down
5 changes: 4 additions & 1 deletion src/Verify/FileNameCleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
':',
'*',
'?',
'/'
'/',
// Not invalid on disk, but reserved: `{prefix}#` is the indexed-target namespace,
// so a `#` in a value would make one case's files look like another case's targets
'#'
];

static char[] invalidPathChars =
Expand Down
2 changes: 1 addition & 1 deletion src/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ All six resolved 2026-08-16 (five fixed here; the inline item resolved as by-des
- [ ] **Sub-millisecond date parameters collide.**
`Verify/Serialization/DateFormatter_DateTime.cs` (and the `DateTimeOffset` twin) use `Second == 0` / `Millisecond == 0` to omit the fraction, but sub-millisecond ticks leave those properties 0. `AddTicks(1)` and `AddTicks(2)` cases format identically → spurious "prefix has already been used" (or silent sharing of one verified file). Correct check is ticks-based.

- [ ] **`#` in parameter values collides with the indexed-target namespace.**
- [x] **`#` in parameter values collides with the indexed-target namespace.**
`Verify/Naming/MatchingFileFinder.cs:9,20` — `indexedPattern: "{prefix}#"` matches by prefix, and `#` is not sanitized. Cases `"x"` and `"x#1"` on one method: running `"x"` deletes `C.M_p=x#1.received.txt` and sweeps `C.M_p=x#1.verified.txt` into the stale set (deleted under AutoVerify).

- [ ] **Trimmed fraction format collapses into a standard format specifier.**
Expand Down
Loading