digitalmars.D.announce - unit-threaded v0.6.26 - advanced unit testing in D with new features
- Atila Neves (9/9) Aug 05 2016 https://code.dlang.org/packages/unit-threaded
- =?UTF-8?B?w5hpdmluZA==?= (13/22) Aug 05 2016 Thanks!
- Sebastiaan Koppe (3/4) Aug 06 2016 Most of my unittests now run in < 100ms; it is great.
- Atila Neves (9/35) Aug 08 2016 In my case, unit tests are fast by definition. If I use
- Nicholas Wilson (4/19) Aug 06 2016 > adder(2 + 3).shouldEqual(5);
- Atila Neves (3/27) Aug 08 2016 Thanks! I'll go fix it.
- Atila Neves (4/28) Aug 08 2016 No, turns out it was right after all. There's a `ShouldFail` UDA
- Alix Pexton (4/35) Aug 08 2016 But you are passing the expression (2 + 3), rather than a tuple of
- Atila Neves (3/23) Aug 08 2016 Ah, right, oops :$ Changing it...
https://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! Atila
Aug 05 2016
On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:https://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! AtilaThanks! I have started using unit_threaded, and love it. The other day, I was thinking about how to run tests optimally. Not sure if you are doing this at the moment. For every test-run, you could record the time each individual test takes. You could then give two options for running the tests: 1) Fast tests first, to quickly see if things look ok 2) Slow tests first, trying to optimize total runtime Test-times would have to be recorded in a file between runs in order to achieve this. Would also be nice to print the time used by each test next to the tests. -Øivind
Aug 05 2016
On Saturday, 6 August 2016 at 01:50:15 UTC, Øivind wrote:I have started using unit_threaded, and love it.Most of my unittests now run in < 100ms; it is great. Keep up the good work.
Aug 06 2016
On Saturday, 6 August 2016 at 01:50:15 UTC, Øivind wrote:On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:In my case, unit tests are fast by definition. If I use unit-threaded for integration tests (which I've done), then those are in a separate package and I can just select which tests to run that way. If organising by package is too much hassle, you can tag tests now as well: Tags("slow") unittest { ... } And then don't run those with the `~ slow` command-line option. Atilahttps://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! AtilaThanks! I have started using unit_threaded, and love it. The other day, I was thinking about how to run tests optimally. Not sure if you are doing this at the moment. For every test-run, you could record the time each individual test takes. You could then give two options for running the tests: 1) Fast tests first, to quickly see if things look ok 2) Slow tests first, trying to optimize total runtime Test-times would have to be recorded in a file between runs in order to achieve this. Would also be nice to print the time used by each test next to the tests. -Øivind
Aug 08 2016
On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:https://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! AtilaThere is a typo in your readmeint adder(int i, int j) { return i + j; } ("Test adder") unittest {> adder(2 + 3).shouldEqual(5);} ("Test adder fails", ShouldFail) unittest { adder(2 + 3).shouldEqual(7); }shouldBe (!) adder(2, 3)
Aug 06 2016
On Saturday, 6 August 2016 at 10:34:52 UTC, Nicholas Wilson wrote:On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:Thanks! I'll go fix it. Atilahttps://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! AtilaThere is a typo in your readmeint adder(int i, int j) { return i + j; } ("Test adder") unittest {> adder(2 + 3).shouldEqual(5);} ("Test adder fails", ShouldFail) unittest { adder(2 + 3).shouldEqual(7); }shouldBe (!) adder(2, 3)
Aug 08 2016
On Saturday, 6 August 2016 at 10:34:52 UTC, Nicholas Wilson wrote:On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:No, turns out it was right after all. There's a `ShouldFail` UDA on that test. Atilahttps://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! AtilaThere is a typo in your readmeint adder(int i, int j) { return i + j; } ("Test adder") unittest {> adder(2 + 3).shouldEqual(5);} ("Test adder fails", ShouldFail) unittest { adder(2 + 3).shouldEqual(7); }shouldBe (!) adder(2, 3)
Aug 08 2016
On 08/08/2016 08:37, Atila Neves wrote:On Saturday, 6 August 2016 at 10:34:52 UTC, Nicholas Wilson wrote:But you are passing the expression (2 + 3), rather than a tuple of arguments (2, 3)! A...On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:No, turns out it was right after all. There's a `ShouldFail` UDA on that test. Atilahttps://code.dlang.org/packages/unit-threaded What's new: . Mocking support. Classes, interfaces and structs can be mocked (see README.md or examples) . Shrinking support for property-based testing, but only for integrals and arrays . Bug fixes Enjoy! AtilaThere is a typo in your readmeint adder(int i, int j) { return i + j; } ("Test adder") unittest {> adder(2 + 3).shouldEqual(5);} ("Test adder fails", ShouldFail) unittest { adder(2 + 3).shouldEqual(7); }shouldBe (!) adder(2, 3)
Aug 08 2016
On Monday, 8 August 2016 at 08:24:48 UTC, Alix Pexton wrote:On 08/08/2016 08:37, Atila Neves wrote:Ah, right, oops :$ Changing it... AtilaOn Saturday, 6 August 2016 at 10:34:52 UTC, Nicholas Wilson wrote:But you are passing the expression (2 + 3), rather than a tuple of arguments (2, 3)! A...On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:No, turns out it was right after all. There's a `ShouldFail` UDA on that test. Atila[...]There is a typo in your readme[...]shouldBe (!) adder(2, 3)
Aug 08 2016