Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to accept changes detected by VerifyTests?
MaxRonin
#1 Posted : Wednesday, October 26, 2022 2:20:26 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 32
Location: Austria

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
I'm using VerifyTests (formerly knows as ApprovalTests).

When I have a failure - the .verified and the .received files mismatch - and I run the test manually, my diff tool (WinMerge) opens and shows me the differences correctly.

However, I got no way of accepting that changes in the received file. WinMerge only offers me to copy from verified to received, not the other way round.

I suspect the reason is that the verified file copied into NCrunches workspace is readonly.

But even if that was not the case, copying from received to verified wouldn't help me because it would copy into the verified file in NCrunch's workspace, not into the verfied file in my actual test project.

I tried to use DiffEngineTray (a tool from VerifyTests) and when I say "accept" there, it seems to succeed, but there are no changes to the verified file in my test-project - so I think that confirms my theory from the paragraph above.

Now I don't see any good workflow here - what I'm currently doing is copy the received side from WinMerge and then paste it over the verified file in VS. But, apart from being cumbersome, this has two disadvantages:
a) I cannot easily just accept some of the changes in received
b) pasting into a file in VS changes whitespace (tabs, spaces, maybe because the files are generated code files, I'm working on a source generator) which I then need to manually fix

Am I missing some configuration option here that might help me?

Many thanks,
MR
SimonCropp
#2 Posted : Friday, October 28, 2022 12:34:52 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/22/2012(UTC)
Posts: 5
Location: ACT

Was thanked: 4 time(s) in 3 post(s)
Max

Can you try version 18.1.1
2 users thanked SimonCropp for this useful post.
MaxRonin on 10/28/2022(UTC), Remco on 10/28/2022(UTC)
MaxRonin
#3 Posted : Friday, October 28, 2022 12:47:07 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 32
Location: Austria

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Yes, that solves it completely - very cool, thank you!
Remco
#4 Posted : Friday, October 28, 2022 10:52:51 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,667

Thanks: 877 times
Was thanked: 1191 time(s) in 1111 post(s)
I just want to add here that Simon saw this problem, implemented a change and released it in a few hours specifically to provide a solution for this.

Thanks Simon.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.041 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download