Skip to content

Commit 19e4e72

Browse files
committed
Merge branch 'main' into CrossChunkMatcher2
2 parents cc75e9c + 22f3fe3 commit 19e4e72

File tree

13 files changed

+104
-43
lines changed

13 files changed

+104
-43
lines changed

docs/temp-directory.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void Usage()
3535
// Directory and files automatically deleted here
3636
}
3737
```
38-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L35-L48' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectory' title='Start of snippet'>anchor</a></sup>
38+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L41-L54' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectory' title='Start of snippet'>anchor</a></sup>
3939
<!-- endSnippet -->
4040

4141

@@ -64,7 +64,7 @@ public void PathProperty()
6464
Assert.True(Path.IsPathRooted(path));
6565
}
6666
```
67-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L232-L243' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryPathProperty' title='Start of snippet'>anchor</a></sup>
67+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L238-L249' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryPathProperty' title='Start of snippet'>anchor</a></sup>
6868
<!-- endSnippet -->
6969

7070

@@ -93,7 +93,7 @@ public void StringConversion()
9393
Trace.WriteLine(files.Count());
9494
}
9595
```
96-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L50-L65' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryStringConversion' title='Start of snippet'>anchor</a></sup>
96+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L56-L71' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryStringConversion' title='Start of snippet'>anchor</a></sup>
9797
<!-- endSnippet -->
9898

9999

@@ -118,7 +118,7 @@ public void DirectoryInfoConversion()
118118
Trace.WriteLine(files.Count());
119119
}
120120
```
121-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L67-L83' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryDirectoryInfoConversion' title='Start of snippet'>anchor</a></sup>
121+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L73-L89' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryDirectoryInfoConversion' title='Start of snippet'>anchor</a></sup>
122122
<!-- endSnippet -->
123123

124124

@@ -142,7 +142,7 @@ public void InfoProperty()
142142
temp.Info.CreateSubdirectory("Subdirectory");
143143
}
144144
```
145-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L85-L100' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryInfoProperty' title='Start of snippet'>anchor</a></sup>
145+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L91-L106' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryInfoProperty' title='Start of snippet'>anchor</a></sup>
146146
<!-- endSnippet -->
147147

148148

@@ -158,7 +158,7 @@ public void RootDirectory() =>
158158
// Accessing the root directory for all TempDirectory instances
159159
Trace.WriteLine(TempDirectory.RootDirectory);
160160
```
161-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L102-L109' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryRootDirectory' title='Start of snippet'>anchor</a></sup>
161+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L108-L115' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryRootDirectory' title='Start of snippet'>anchor</a></sup>
162162
<!-- endSnippet -->
163163

164164

@@ -222,7 +222,7 @@ public async Task BuildPath()
222222
});
223223
}
224224
```
225-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L292-L312' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryBuildPath' title='Start of snippet'>anchor</a></sup>
225+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L298-L318' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryBuildPath' title='Start of snippet'>anchor</a></sup>
226226
<!-- endSnippet -->
227227

228228

@@ -244,7 +244,7 @@ public async Task Scrubbing()
244244
});
245245
}
246246
```
247-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L314-L329' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryScrubbing' title='Start of snippet'>anchor</a></sup>
247+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L320-L335' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryScrubbing' title='Start of snippet'>anchor</a></sup>
248248
<!-- endSnippet -->
249249

250250
Result:
@@ -289,7 +289,7 @@ public void NoUsing()
289289
Debug.WriteLine(temp);
290290
}
291291
```
292-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L275-L288' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryNoUsing' title='Start of snippet'>anchor</a></sup>
292+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L281-L294' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryNoUsing' title='Start of snippet'>anchor</a></sup>
293293
<!-- endSnippet -->
294294

295295
The directory can then be manually inspected.
@@ -313,7 +313,7 @@ public void OpenExplorerAndDebug()
313313
temp.OpenExplorerAndDebug();
314314
}
315315
```
316-
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L260-L273' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryOpenExplorerAndDebug' title='Start of snippet'>anchor</a></sup>
316+
<sup><a href='/src/Verify.Tests/TempDirectoryTests.cs#L266-L279' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempDirectoryOpenExplorerAndDebug' title='Start of snippet'>anchor</a></sup>
317317
<!-- endSnippet -->
318318

319319
This method is designed to help debug tests by enabling the inspection of the contents of the temporary directory while the test is paused. It performs two actions:

docs/temp-file.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void Usage()
3434
// file automatically deleted here
3535
}
3636
```
37-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L32-L44' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFile' title='Start of snippet'>anchor</a></sup>
37+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L38-L50' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFile' title='Start of snippet'>anchor</a></sup>
3838
<!-- endSnippet -->
3939

4040

@@ -62,7 +62,7 @@ public void PathProperty()
6262
Assert.True(Path.IsPathRooted(path));
6363
}
6464
```
65-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L46-L56' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFilePathProperty' title='Start of snippet'>anchor</a></sup>
65+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L52-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFilePathProperty' title='Start of snippet'>anchor</a></sup>
6666
<!-- endSnippet -->
6767

6868

@@ -91,7 +91,7 @@ public void StringConversion()
9191
Trace.WriteLine(content);
9292
}
9393
```
94-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L327-L342' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileStringConversion' title='Start of snippet'>anchor</a></sup>
94+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L333-L348' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileStringConversion' title='Start of snippet'>anchor</a></sup>
9595
<!-- endSnippet -->
9696

9797

@@ -114,7 +114,7 @@ public void FileInfoConversion()
114114
Trace.WriteLine(directoryName);
115115
}
116116
```
117-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L344-L358' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileFileInfoConversion' title='Start of snippet'>anchor</a></sup>
117+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L350-L364' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileFileInfoConversion' title='Start of snippet'>anchor</a></sup>
118118
<!-- endSnippet -->
119119

120120

@@ -135,7 +135,7 @@ public void InfoProperty()
135135
Trace.WriteLine(directoryName);
136136
}
137137
```
138-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L360-L372' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileInfoProperty' title='Start of snippet'>anchor</a></sup>
138+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L366-L378' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileInfoProperty' title='Start of snippet'>anchor</a></sup>
139139
<!-- endSnippet -->
140140

141141

@@ -151,7 +151,7 @@ public void RootDirectory() =>
151151
// Accessing the root directory for all TempDirectory instances
152152
Trace.WriteLine(TempFile.RootDirectory);
153153
```
154-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L108-L115' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileRootDirectory' title='Start of snippet'>anchor</a></sup>
154+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L114-L121' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileRootDirectory' title='Start of snippet'>anchor</a></sup>
155155
<!-- endSnippet -->
156156

157157

@@ -186,7 +186,7 @@ public async Task VerifyFileInstance()
186186
await VerifyFile(file);
187187
}
188188
```
189-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L20-L30' title='Snippet source file'>snippet source</a> | <a href='#snippet-VerifyTempFile' title='Start of snippet'>anchor</a></sup>
189+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L26-L36' title='Snippet source file'>snippet source</a> | <a href='#snippet-VerifyTempFile' title='Start of snippet'>anchor</a></sup>
190190
<!-- endSnippet -->
191191

192192

@@ -207,7 +207,7 @@ public async Task Scrubbing()
207207
});
208208
}
209209
```
210-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L90-L104' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileScrubbing' title='Start of snippet'>anchor</a></sup>
210+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L96-L110' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileScrubbing' title='Start of snippet'>anchor</a></sup>
211211
<!-- endSnippet -->
212212

213213
Result:
@@ -251,7 +251,7 @@ public void NoUsing()
251251
Debug.WriteLine(temp);
252252
}
253253
```
254-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L73-L86' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileNoUsing' title='Start of snippet'>anchor</a></sup>
254+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L79-L92' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileNoUsing' title='Start of snippet'>anchor</a></sup>
255255
<!-- endSnippet -->
256256

257257
The file can then be manually inspected.
@@ -275,7 +275,7 @@ public void OpenExplorerAndDebug()
275275
temp.OpenExplorerAndDebug();
276276
}
277277
```
278-
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L58-L71' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileOpenExplorerAndDebug' title='Start of snippet'>anchor</a></sup>
278+
<sup><a href='/src/Verify.Tests/TempFileTests.cs#L64-L77' title='Snippet source file'>snippet source</a> | <a href='#snippet-TempFileOpenExplorerAndDebug' title='Start of snippet'>anchor</a></sup>
279279
<!-- endSnippet -->
280280

281281
This method is designed to help debug tests by enabling the inspection of the contents of the temporary file while the test is paused. It performs two actions:

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CA1822;CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget;xUnit1051;NU1608;NU1109</NoWarn>
5-
<Version>31.7.2</Version>
5+
<Version>31.7.3</Version>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<LangVersion>preview</LangVersion>
88
<AssemblyVersion>1.0.0</AssemblyVersion>

src/Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PackageVersion Include="NUnit3TestAdapter" Version="5.2.0" />
2525
<PackageVersion Include="Polyfill" Version="9.3.0" />
2626
<PackageVersion Include="ProjectDefaults" Version="1.0.163" />
27-
<PackageVersion Include="PublicApiGenerator" Version="11.5.1" />
27+
<PackageVersion Include="PublicApiGenerator" Version="11.5.3" />
2828
<PackageVersion Include="SimpleInfoName" Version="3.1.2" />
2929
<PackageVersion Include="System.Drawing.Common" Version="10.0.0" />
3030
<PackageVersion Include="System.Memory" Version="4.6.3" />
@@ -37,8 +37,8 @@
3737
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
3838
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.3" />
3939
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
40-
<PackageVersion Include="xunit.v3" Version="3.2.0" />
41-
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.0" />
40+
<PackageVersion Include="xunit.v3" Version="3.2.1" />
41+
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.1" />
4242
<PackageVersion Include="YoloDev.Expecto.TestSdk" Version="0.15.5" />
4343
<PackageVersion Include="Microsoft.Sbom.Targets" Version="4.1.4" />
4444
</ItemGroup>

src/RawTempUsage/GlobalUsings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Global using directives
2+
3+
global using VerifyTests;
4+
global using Xunit;

src/RawTempUsage/RawTempUsage.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class RawTempUsage
2+
{
3+
[Fact]
4+
public void Directory()
5+
{
6+
using var directory = new TempDirectory();
7+
}
8+
9+
[Fact]
10+
public void File()
11+
{
12+
using var file = new TempFile();
13+
}
14+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
6+
<PlatformTarget>x64</PlatformTarget>
7+
<OutputType>Exe</OutputType>
8+
<NoWarn>$(NoWarn);CS8002</NoWarn>
9+
<RootNamespace>Fake</RootNamespace>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\Verify\Verify.csproj" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
15+
<PackageReference Include="ProjectDefaults" PrivateAssets="all" />
16+
<PackageReference Include="MarkdownSnippets.MsBuild" PrivateAssets="all" />
17+
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
18+
<PackageReference Include="xunit.v3" />
19+
</ItemGroup>
20+
21+
</Project>

src/Verify.Tests/TempDirectoryTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public async Task VerifyDirectoryInstance()
3232

3333
#endregion
3434

35+
[Fact]
36+
public void WithNoVerify()
37+
{
38+
using var directory = new TempDirectory();
39+
}
40+
3541
#region TempDirectory
3642

3743
[Fact]

src/Verify.Tests/TempFileTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
public class TempFileTests
22
{
3+
[Fact]
4+
public void WithNoVerify()
5+
{
6+
using var temp = new TempFile();
7+
}
8+
39
[Fact]
410
public void Constructor_CreatesFilePathInRootDirectory()
511
{

src/Verify.slnx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
<Project Path="Benchmarks/Benchmarks.csproj" />
1717
<Project Path="DeterministicTests/DeterministicTests.csproj" />
1818
<Project Path="DisableScrubbersTests/DisableScrubbersTests.csproj" />
19-
<Project Path="DisableVerifyFileNestingTests/DisableVerifyFileNestingTests.csproj" Type="C#" />
19+
<Project Path="DisableVerifyFileNestingTests/DisableVerifyFileNestingTests.csproj" />
2020
<Project Path="FakeDiffTool/FakeDiffTool.csproj" />
2121
<Project Path="FSharpTests/FSharpTests.fsproj" />
2222
<Project Path="ModuleInitDocs/ModuleInitDocs.csproj" />
2323
<Project Path="NullComparer/NullComparer.csproj" />
24+
<Project Path="RawTempUsage/RawTempUsage.csproj" />
2425
<Project Path="StaticSettingsTests/StaticSettingsTests.csproj" />
2526
<Project Path="StrictJsonTests/StrictJsonTests.csproj" />
2627
<Project Path="TargetLibrary/TargetLibrary.csproj" />

0 commit comments

Comments
 (0)