cmeeren / faqt Goto Github PK
View Code? Open in Web Editor NEWFluent assertions for F#
License: MIT License
Fluent assertions for F#
License: MIT License
Not immediately planning this, just noting that a few assertions (like Be
) might be improved by rendering some kind of diff in the assertion message.
The diff could be made via e.g. Diffract.
Drawbacks/caveats:
Not immediately planning this, just noting that it could be worth investigating a compatibility checker as part of Faqt's test suite, to prevent accidental breaking changes.
Relevant links:
Not immediately planning this, just noting that it could be worth investigating mutation testing (e.g. Stryker) to ensure good test coverage of Faqt's test suite.
Possibly relevant material: How To Test C# Unit Tests With Mutation Testing
It is possible to annotate a parameter with [<ReflectedDefinition(true)>]
. The usage syntax stays the same, but it will then be of type Expr<_>
and match the pattern Microsoft.FSharp.Quotations.Patterns.WithValue
, where we can get the value (without having to manually evaluate the expression) as well as the expression for the parameter.
This could be used in assertions like Be(expected, isEqual)
to get the name/expression of the custom comparer and include it in the assertion failure output.
Unfortunately, this has two significant drawbacks:
Quotations have several limitations, e.g., no calls to inner generic functions, some problems with mutable values, etc. This requires the user to adapt their code. (This is one of the reasons I no longer use Unquote.) This is made worse due to the fact that the user is seemingly not writing an expression (this fact is hidden from the user by ReflectedDefinition
), likely causing confusion.
Sensibly printing the expression tree can be difficult. This code could be adapted, but I am unsure how complete it and what it doesn't handle, and after experimenting a bit, I find it hard to get the results I want. It seems the the expression tree does not contain enough information to render something sufficiently close to the original code, even for simple values like a curried function as the isEqual
parameter.
I find that either of the points above is a sufficient reason for dropping this feature.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.