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
16 changes: 8 additions & 8 deletions Tests/Verify.Nupkg.Tests/NuspecScrubbingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
[TestClass]
public partial class NuspecScrubbingTests
{
private string _packageWithRepoGitExtension = SamplePackages.Instance.PackageWithRepoGitExtension.Value.FullName;
private string _packageWithoutRepoGitExtension = SamplePackages.Instance.PackageWithoutRepoGitExtension.Value.FullName;
private string _packageWithoutRepoHttps = SamplePackages.Instance.PackageWithoutRepoHttps.Value.FullName;
private string _packageWithoutRepoGitHubDomain = SamplePackages.Instance.PackageWithoutRepoGitHubDomain.Value.FullName;
private string _packageWithoutRepoUrl = SamplePackages.Instance.PackageWithoutRepoUrl.Value.FullName;
private string _packageWithoutRepoCommit = SamplePackages.Instance.PackageWithoutRepoCommit.Value.FullName;
private string _packageWithoutRepoBranch = SamplePackages.Instance.PackageWithoutRepoBranch.Value.FullName;
private readonly string _packageWithRepoGitExtension = SamplePackages.Instance.PackageWithRepoGitExtension.Value.FullName;
private readonly string _packageWithoutRepoGitExtension = SamplePackages.Instance.PackageWithoutRepoGitExtension.Value.FullName;
private readonly string _packageWithoutRepoHttps = SamplePackages.Instance.PackageWithoutRepoHttps.Value.FullName;
private readonly string _packageWithoutRepoGitHubDomain = SamplePackages.Instance.PackageWithoutRepoGitHubDomain.Value.FullName;
private readonly string _packageWithoutRepoUrl = SamplePackages.Instance.PackageWithoutRepoUrl.Value.FullName;
private readonly string _packageWithoutRepoCommit = SamplePackages.Instance.PackageWithoutRepoCommit.Value.FullName;
private readonly string _packageWithoutRepoBranch = SamplePackages.Instance.PackageWithoutRepoBranch.Value.FullName;

[TestMethod]
public Task DoNotScrubGitExtensionOnRepoUrl()
Expand Down Expand Up @@ -78,6 +78,6 @@ public Task SkipScrubbingForRepoWithNoBranch()
settings.UseUniqueDirectory();
settings.ScrubNuspec();

return VerifyFile(_packageWithoutRepoUrl, settings);
return VerifyFile(_packageWithoutRepoBranch, settings);
}
}
2 changes: 1 addition & 1 deletion Tests/Verify.Nupkg.Tests/SimplePackageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Verify.Nupkg.Tests;
[TestClass]
public partial class SimplePackageTests
{
private string _simplePackage = SamplePackages.Instance.SimplePackage.Value.FullName;
private readonly string _simplePackage = SamplePackages.Instance.SimplePackage.Value.FullName;

[TestMethod]
public Task BasicTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@
<repository type="git" url="https://github.com/********/Verify.Nupkg.git" branch="********" commit="****************************************" />
<dependencies>
<group targetFramework=".NETFramework4.7.2">
<dependency id="Verify" version="23.0.1" exclude="Build,Analyzers" />
<dependency id="Verify" version="28.13.0" exclude="Build,Analyzers" />
</group>
<group targetFramework="net8.0">
<dependency id="Verify" version="23.0.1" exclude="Build,Analyzers" />
<dependency id="Verify" version="28.13.0" exclude="Build,Analyzers" />
</group>
<group targetFramework="net9.0">
<dependency id="Verify" version="23.0.1" exclude="Build,Analyzers" />
<dependency id="Verify" version="28.13.0" exclude="Build,Analyzers" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.IO.Compression" targetFramework=".NETFramework4.7.2" />
</frameworkAssemblies>
</metadata>
</package>
2 changes: 1 addition & 1 deletion Verify.Nupkg/Verify.Nupkg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<PackageReference Include="Polyfill" Version="7.20.0" PrivateAssets="all" />
<PackageReference Include="Verify" Version="23.0.1" />
<PackageReference Include="Verify" Version="28.13.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="Verify" Version="23.1.0" />
<PackageReference Include="Verify" Version="28.13.0" />
</ItemGroup>

<ItemGroup>
Expand Down
25 changes: 18 additions & 7 deletions benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public class NuspecScrubbing

private readonly VerifySettings _settings;
private readonly Target _target;
private readonly string _verifyFile = Path.Combine(Directory.GetCurrentDirectory(), "can-be-anything.nuspec");
private readonly string _verifyDirectory = Directory.GetCurrentDirectory();
private readonly string _verifyFile = "can-be-anything.nuspec";

public NuspecScrubbing()
{
Expand All @@ -73,18 +74,28 @@ public async Task Baseline()
{
Func<InnerVerifier, Task<VerifyResult>> verify = _ => _.Verify(_target);

await new SettingsTask(_settings, async verifySettings =>
try
{
using var verifier = new InnerVerifier(_verifyFile, verifySettings);
return await verify(verifier);
});
await new SettingsTask(_settings, async verifySettings =>
{
using var verifier = new InnerVerifier(_verifyDirectory, _verifyFile, verifySettings);
return await verify(verifier);
});
}
catch (Exception)
{
// Mismatch is expected
}
}

[GlobalCleanup]
public void Cleanup()
{
string verifiedFile = _verifyFile.Replace(".nuspec", ".verified.nuspec");
File.Delete(verifiedFile);
string receivedFile = Path.Combine(_verifyFile, _verifyFile.Replace(".nuspec", ".verified.nuspec"));
string verifiedFile = Path.Combine(_verifyFile, _verifyFile.Replace(".nuspec", ".verified.nuspec"));

if (File.Exists(receivedFile)) { File.Delete(receivedFile); }
if (File.Exists(verifiedFile)) { File.Delete(verifiedFile); }
}
}

Expand Down
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.0",
"version": "3.0",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/tags/v\\d+\\.\\d+\\.\\d+"
Expand All @@ -10,4 +10,4 @@
"enabled": true
}
}
}
}