Coder Social home page Coder Social logo

Comments (6)

SimonCropp avatar SimonCropp commented on August 16, 2024 1

this can now be controlled using an environment variable https://github.com/VerifyTests/DiffEngine/blob/main/docs/diff-tool.md#leftright-diff-behavior

from approvaltests.net.

SimonCropp avatar SimonCropp commented on August 16, 2024

@MihailsKuzmins

changing DiffRunner.Launch(diffTool, received, approved); wont work DiffRunner.Launch has logic in it that assumes the received and approved are passed in in the correct order.

If you want to change this, it should be a PR in https://github.com/VerifyTests/DiffEngine that inverts the display order via an environment setting

from approvaltests.net.

MihailsKuzmins avatar MihailsKuzmins commented on August 16, 2024

@SimonCropp, thank you that you corrected my mistake of the design.
So as I understood VisualStudio.cs must be changed, to be more specific this line (temp, target) => $"/diff \"{temp}\" \"{target}\"",. So the first file is "received" and the second is "approved".

public void Report(string approved, string received)
{
DiffRunner.Launch(diffTool, received, approved);
}

So I ran this test. And indeed the "received.json" was on the left-hand side.
So in VisualStudio.cs I only made this change and after that the result was as I would expect ("received.json" was on the right-hand side)
image
image

If you agree that this change is all right I will prepare a PR in the DiffEngine.

from approvaltests.net.

SimonCropp avatar SimonCropp commented on August 16, 2024

discussing on diffengine repo so will close this

from approvaltests.net.

MihailsKuzmins avatar MihailsKuzmins commented on August 16, 2024

@SimonCropp,
thank you so much, your solution is more general and will cover similar cases in other reporters.
Tested the new version and it works as expected. Waiting for the new NuGet release

Environment.SetEnvironmentVariable("DiffEngine_TargetOnLeft", "true");

from approvaltests.net.

SimonCropp avatar SimonCropp commented on August 16, 2024

the nuget is deployed. but note that you should not add SetEnvironmentVariable("DiffEngine_TargetOnLeft to your code

from approvaltests.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.