Giter VIP home page Giter VIP logo

diffract's People

Contributors

aloisdg avatar tarmil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

diffract's Issues

Implement ci/cd

Hello!

To simplify the deployment of Diffract, we need a sweet ci/cd. You can find some inspirations from Cardizer and Fasmi.

Good luck :)

Question: is it possible to override the default differ output for a nested type

I have a data structure that contains a deeply nested NodaTime.LocalTime. The diff output is too detailed to be human-readable. I'd like to override the diff output for the LocalTime to show "hh:mm". Is there a way to achieve this?
I see that I can pass an IDiffer to the diff function. But I only want a replacement for LocalTime with as little effort as possible.

Thanks for this great library!

Use icon in paket to get the icon on nuget

Hello!

The logo is currently note visible.

image

Use icon in paket to get the icon on nuget. Note that icon is supported with NuGet 5.3.0 and above.

source

This change is an edit of paket.template. We can add a line with icon ..\diffract-64x64.png. I think it should work.

Cheers,

Better output for strings

The output for different strings just prints the two strings on separate lines. This is fine for short strings, but for longer ones, especially multiline, it can be difficult to find where exactly the difference is. We could take inspiration from other assertion libraries that indicate at which character position the strings begin to differ, and only print the section of the string around that position.

Hint for the person who wants to take up this issue: I think the best way to go would be to add a case String of x1: string * x2: string to the type Diff. This case would be used in Differ.diffWith instead of simpleEquality (which returns a Diff.Value). Its display format would then be applied in DiffPrinter.toStreamImpl.

Add netfx support?

It seems targeting netfx (net472/net48 or netstandard2.0) would be doable without change.
That would no exclude previous framworks from working

Output suggestion: add a new line after AssertionFailedException

It might be visually easier to compare the expected and actual output like this:

To reproduce

Diffract.Assert(true, false)

Actual

Diffract.AssertionFailedException: Expect = true
Actual = false

Expected

Diffract.AssertionFailedException
Expect = true
Actual = false

But not when there is a text after

Diffract.AssertionFailedException: ResultValue collection differs:
  ResultValue[0].Item.Amount Expect = 101M
                             Actual = 10M

The goal would be to have a alignement between Expect and Actual.

API is inconvenient to call from C#

C# seems to have odd behavior when trying to use a type whose name is the same as a namespace. Calling Diffract.Assert poses no issue in the project's tests: they are inside the Diffract namespace and therefore have the class Diffract.Diffract in scope. But in a real-life project, using Diffract doesn't work as well:

namespace MyNamespace;

using Diffract;

Diffract.Assert(1, 2);
// Error CS0234 : The type or namespace name 'Assert' does not exist in the namespace 'Diffract' (are you missing an assembly reference?)

The compiler thinks we're trying to use the namespace Diffract when we're in fact trying to use the class Diffract. The solution right now is to fully qualify the call:

Diffract.Diffract.Assert(1, 2);

But that's not very nice; we should fix this. It's okay to change the API, that's what version 0.x is for ๐Ÿ˜‰

We have several options to remove the ambiguity:

  • Nest the namespace, for example Dedge.Diffract.
  • Change the class name. Differ maybe? (we can put ModuleSuffix on the existing F# module to avoid a duplicate definition)
  • Other ideas?

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.