Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verifying byte arrays has different behavior in v18 than in v17 #689

Closed
xt0rted opened this issue Oct 31, 2022 · 3 comments · Fixed by #690
Closed

Verifying byte arrays has different behavior in v18 than in v17 #689

xt0rted opened this issue Oct 31, 2022 · 3 comments · Fixed by #690

Comments

@xt0rted
Copy link

xt0rted commented Oct 31, 2022

Describe the bug

I'm updating from v17.10.2 to v18.1.1 (also tried v18.0.0) and one of my tests started to fail. The verification files prior to v18 were .bin but now they're .txt with different contents in them. This looks to probably be due to the changes in #656. That PR also isn't listed in the release notes.

I was calling Verify(bytes) but now I have to call Verify(bytes, extension: "bin") to get the same results. I'm not sure if this is a bug or the intended behavior after those changes.

Minimal Repro

This is the PR where the issue came up xt0rted/dotnet-startup-projects#10

@xt0rted
Copy link
Author

xt0rted commented Oct 31, 2022

@SimonCropp I just updated to 18.2.0 and switched this:

await Verify(File.ReadAllBytesAsync(suoPath), extension: "bin").UseParameters(version, folder);

to this:

await Verify(File.ReadAllBytesAsync(suoPath)).UseParameters(version, folder);

Now I'm getting the following error:

C:\dev\xt0rted\dotnet-startup-projects\test\SetCommandTests.cs(90,15): error CS0121: The call is ambiguous between the following methods or properties: 'Verifier.Verify<T>(Task<T>, VerifySettings?, string)' and 'Verifier.Verify(Task<byte[]>, VerifySettings?, object?, string)' [C:\dev\xt0rted\dotnet-startup-projects\test\Tests.csproj]

If I switch back to my original code where I await the method then it builds ok.

await Verify(await File.ReadAllBytesAsync(suoPath)).UseParameters(version, folder);

@SimonCropp
Copy link
Member

@xt0rted can u try 18.3.0

@xt0rted
Copy link
Author

xt0rted commented Nov 2, 2022

@SimonCropp 18.3.0 works great, thanks! Both with and without the await work as they used to in my test xt0rted/dotnet-startup-projects#15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants