www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - New fluent asserts library for D

reply Nick Papanastasiou <nickpap9411 gmail.com> writes:
Hey guys!

My new job has some room for me to use D at work, so before I do 
anything serious there I've been trying to work through some 
personal projects. The vast majority of my day job is Java, and 
I've really been enjoying the AssertJ library 
(http://joel-costigliola.github.io/assertj/) in my unit tests, 
and thought it was a shame that I couldn't find something similar 
for D.

Here's what I've come up with so far: 
https://github.com/NickPapanastasiou/describe

Obviously still in very early stages. At the moment, docs are 
lacking and failure messages need to be made clear, but it's 
fairly usable. Any and all feedback is welcome and appreciated!
Mar 14 2019
next sibling parent Jonathan Marler <johnnymarler gmail.com> writes:
On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou 
wrote:
 Hey guys!

 My new job has some room for me to use D at work, so before I 
 do anything serious there I've been trying to work through some 
 personal projects. The vast majority of my day job is Java, and 
 I've really been enjoying the AssertJ library 
 (http://joel-costigliola.github.io/assertj/) in my unit tests, 
 and thought it was a shame that I couldn't find something 
 similar for D.

 Here's what I've come up with so far: 
 https://github.com/NickPapanastasiou/describe

 Obviously still in very early stages. At the moment, docs are 
 lacking and failure messages need to be made clear, but it's 
 fairly usable. Any and all feedback is welcome and appreciated!
Why not make AssertBuilder a struct instead of a class? Doing so allows it to be used with nogc/betterC, and you're not making more garbage for the GC to clean up later.
Mar 15 2019
prev sibling parent reply Seb <seb wilzba.ch> writes:
On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou 
wrote:
 and thought it was a shame that I couldn't find something 
 similar for D.
Did you have a look at fluent-asserts? https://code.dlang.org/packages/fluent-asserts
Mar 15 2019
next sibling parent Andre Pany <andre s-e-a-p.de> writes:
On Friday, 15 March 2019 at 10:35:59 UTC, Seb wrote:
 On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou 
 wrote:
 and thought it was a shame that I couldn't find something 
 similar for D.
Did you have a look at fluent-asserts? https://code.dlang.org/packages/fluent-asserts
I do not know the reason why it was not found, but searching for "assert" on code.dlang.org is not easy. Packages with "assert" in name have no priority. It is very easy to come to the conclusion there is no such package. Fluent-asserts is hidden somewhere on a long list with completely unrelated packages (mir, mysql, pegged, ...) Kind regards Andre
Mar 15 2019
prev sibling parent FeepingCreature <feepingcreature gmail.com> writes:
On Friday, 15 March 2019 at 10:35:59 UTC, Seb wrote:
 On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou 
 wrote:
 and thought it was a shame that I couldn't find something 
 similar for D.
Did you have a look at fluent-asserts? https://code.dlang.org/packages/fluent-asserts
Also dshould? https://code.dlang.org/packages/dshould (Meant to run with unit-threaded.)
Mar 20 2019