www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.internals - lexer.d and unittests

reply Walter Bright <newshound2 digitalmars.com> writes:
https://codecov.io/gh/dlang/dmd/src/master/src/dmd/lexer.d

Despite having unittests, it is only 30% covered, which is simply terrible. 
Anyone care to add more coverage tests?
Aug 05 2019
parent reply Jacob Carlborg <doob me.com> writes:
On 2019-08-06 01:36, Walter Bright wrote:
 https://codecov.io/gh/dlang/dmd/src/master/src/dmd/lexer.d
 
 Despite having unittests, it is only 30% covered, which is simply 
 terrible. Anyone care to add more coverage tests?
I highly recommend adding tests like these [1]. Some more examples [2] [3]. [1] https://github.com/dlang/dmd/tree/master/test/unit/lexer [2] https://github.com/dlang/dmd/pull/10010 [3] https://github.com/dlang/dmd/pull/9963 -- /Jacob Carlborg
Aug 07 2019
parent Walter Bright <newshound2 digitalmars.com> writes:
On 8/7/2019 2:52 AM, Jacob Carlborg wrote:
 On 2019-08-06 01:36, Walter Bright wrote:
 https://codecov.io/gh/dlang/dmd/src/master/src/dmd/lexer.d

 Despite having unittests, it is only 30% covered, which is simply terrible. 
 Anyone care to add more coverage tests?
I highly recommend adding tests like these [1]. Some more examples [2] [3]. [1] https://github.com/dlang/dmd/tree/master/test/unit/lexer [2] https://github.com/dlang/dmd/pull/10010 [3] https://github.com/dlang/dmd/pull/9963
I was able to fully unittest the Warp lexer without building a test harness, just using basic unittests: https://github.com/facebookarchive/warp/blob/master/lexer.d#L852 In fact, Warp was the most fully unittested project I've ever done, and it had remarkably few bugs found in the field.
Aug 07 2019