Skip to content

Add mirror source structure for verified files#1800

Merged
SimonCropp merged 5 commits into
mainfrom
mirror-source-structure
Jul 17, 2026
Merged

Add mirror source structure for verified files#1800
SimonCropp merged 5 commits into
mainfrom
mirror-source-structure

Conversation

@SimonCropp

@SimonCropp SimonCropp commented Jul 16, 2026

Copy link
Copy Markdown
Member

fixes #1758

Nests `.verified.` files in sub-directories that mirror the directory
structure of the test source files relative to the project directory, so
a test in Foo/FooTests.cs writes to Snapshots/Foo instead of a flat
Snapshots folder. This makes orphaned snapshots easier to identify when
test source files are moved, renamed, or removed.

Behavior is unchanged when the option is not set.

The derivation is shared via the public PathInfo.DeriveProjectRelative so
all six adapters use one implementation. It cannot live on core
Extensions/IoHelpers: each adapter has a local Extensions.cs that shadows
the core type, and Verify.Fixie is unsigned so it has no
InternalsVisibleTo access to core internals.

Resolves #1758
@SimonCropp SimonCropp added this to the 31.25.0 milestone Jul 16, 2026
Adding an optional parameter changed the method signature, so assemblies
compiled against the single argument overload would fail at runtime with
a MissingMethodException.

Restore the single argument overload and mark it obsolete, and apply
OverloadResolutionPriority to the mirrorSourceStructure overload so
source callers bind to it rather than to the obsolete one. The obsolete
overload remains only to keep existing binaries working.

Polyfill supplies OverloadResolutionPriorityAttribute for the target
frameworks whose BCL lacks it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

UseProjectRelative + SourceFileRelativeDirectory

1 participant