Re: Unit Testing in Action

2017-11-28 Thread John Carter via Digitalmars-d-announce
On Friday, 20 October 2017 at 14:04:25 UTC, Mike Parker wrote: https://dlang.org/blog/2017/10/20/unit-testing-in-action/ I'm somewhat late to this party but anyway, here is my two cents on the way Unit testing needs to be tweaked. One of the values of Unit Testing is Defect

Re: Unit Testing in Action

2017-10-26 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-10-25 04:15, Walter Bright wrote: The problem is how to display it in a text file with the original source code. An option to output the result in XML or JSON would allow an editor or IDE more options to display the result, for example, hover on different expressions to show the

Re: Unit Testing in Action

2017-10-25 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, October 24, 2017 19:15:35 Walter Bright via Digitalmars-d- announce wrote: > On 10/24/2017 3:06 PM, Ali Çehreli wrote: > > It would be very useful if the compiler could do that automatically. > > On 10/24/2017 2:58 PM, qznc wrote: > > The information is there just not expressed in a

Re: Unit Testing in Action

2017-10-24 Thread Ali Çehreli via Digitalmars-d-announce
On 10/24/2017 07:15 PM, Walter Bright wrote: On 10/24/2017 3:06 PM, Ali Çehreli wrote: It would be very useful if the compiler could do that automatically. On 10/24/2017 2:58 PM, qznc wrote: > The information is there just not expressed in a useable way. The problem is how to display it in

Re: Unit Testing in Action

2017-10-24 Thread Ali Çehreli via Digitalmars-d-announce
On 10/24/2017 01:51 PM, Walter Bright wrote: > On 10/23/2017 4:44 AM, Martin Nowak wrote: > There would be a separate coverage count for line 3 which would be the > sum of counts for (api2 == 2) and (api3 == 3). > > Generally, if this is inadequate, just split the expression into more > lines.

Re: Unit Testing in Action

2017-10-24 Thread Walter Bright via Digitalmars-d-announce
On 10/23/2017 4:44 AM, Martin Nowak wrote: On Saturday, 21 October 2017 at 22:50:51 UTC, Walter Bright wrote: Coverage would give: 1|    x = 2; 2|    if (x == 1 || x == 2) I.e. the second line gets an execution count of 2. By contrast, 1|    x = 1; 1|    if (x == 1 || x == 2) Interesting

Re: Unit Testing in Action

2017-10-24 Thread Mario Kröplin via Digitalmars-d-announce
On Monday, 23 October 2017 at 12:38:01 UTC, Atila Neves wrote: "parallel test execution (from it’s name, the main goal of unit-threaded) was quite problematic with the first test suite we converted" I'd love to know what the problems were, especially since it's possible to run in just one

Re: Unit Testing in Action

2017-10-23 Thread Atila Neves via Digitalmars-d-announce
of using third-party frameworks. Blog: https://dlang.org/blog/2017/10/20/unit-testing-in-action/ Reddit: https://www.reddit.com/r/programming/comments/77m8r8/ds_builtin_unit_testing_in_action/ "Only for troubleshooting should you switch to unit-threaded. You have to be careful, however, to onl

Re: Unit Testing in Action

2017-10-23 Thread Martin Nowak via Digitalmars-d-announce
On Saturday, 21 October 2017 at 22:50:51 UTC, Walter Bright wrote: Coverage would give: 1|x = 2; 2|if (x == 1 || x == 2) I.e. the second line gets an execution count of 2. By contrast, 1|x = 1; 1|if (x == 1 || x == 2) Interesting point, but would likely fail for more complex

Re: Unit Testing in Action

2017-10-23 Thread Anton Fediushin via Digitalmars-d-announce
of using third-party frameworks. Blog: https://dlang.org/blog/2017/10/20/unit-testing-in-action/ Reddit: https://www.reddit.com/r/programming/comments/77m8r8/ds_builtin_unit_testing_in_action/ Yay! My app - covered is in this post! That's so cool, when somebody uses your code. Thank you, Mario.

Re: Unit Testing in Action

2017-10-22 Thread Nordlöw via Digitalmars-d-announce
On Saturday, 21 October 2017 at 22:50:51 UTC, Walter Bright wrote: What's happening here is each of the operands of || are considered to be separate statements as far as coverage analysis goes. It becomes clearer if it is reformatted as: 1|x = 2; 1|if (x == 1 || 1|x == 2) or:

Re: Unit Testing in Action

2017-10-21 Thread Walter Bright via Digitalmars-d-announce
On 10/21/2017 6:14 AM, Martin Nowak wrote: On Friday, 20 October 2017 at 21:26:35 UTC, qznc wrote: * coverage is not sufficiently solved. The author suggests to reformat code so short-circuit evaluations become multiple lines? If you can use gdc or ldc, branch coverage should be supported out

Re: Unit Testing in Action

2017-10-21 Thread Mario Kröplin via Digitalmars-d-announce
On Friday, 20 October 2017 at 21:26:35 UTC, qznc wrote: * fluent-asserts is considered the best expectations library. Syntax is `(x + y).should.equal(42).because("of test reasons");` and it gives nice output with code snippets. The code snippets were the prominent feature from the

Re: Unit Testing in Action

2017-10-21 Thread Martin Nowak via Digitalmars-d-announce
On Friday, 20 October 2017 at 21:26:35 UTC, qznc wrote: * coverage is not sufficiently solved. The author suggests to reformat code so short-circuit evaluations become multiple lines? If you can use gdc or ldc, branch coverage should be supported out of the box. Other tools support regions

Re: Unit Testing in Action

2017-10-20 Thread qznc via Digitalmars-d-announce
of using third-party frameworks. Blog: https://dlang.org/blog/2017/10/20/unit-testing-in-action/ Reddit: https://www.reddit.com/r/programming/comments/77m8r8/ds_builtin_unit_testing_in_action/ Thanks for this post. Personally, I have not really hit the pain points described here, so I learned

Unit Testing in Action

2017-10-20 Thread Mike Parker via Digitalmars-d-announce
/10/20/unit-testing-in-action/ Reddit: https://www.reddit.com/r/programming/comments/77m8r8/ds_builtin_unit_testing_in_action/