automatically verifying code samples in phobos docs
Timon Gehr via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 19 17:09:12 PDT 2015
On 08/20/2015 02:02 AM, Laeeth Isharc wrote:
> On Thursday, 20 August 2015 at 00:00:55 UTC, Timon Gehr wrote:
>> On 08/20/2015 01:41 AM, Laeeth Isharc wrote:
>>>
>>> BTW I don't know why you can't convert a char[] to string - seems
>>> harmless enough conversion that way around.
>>
>> It would need to allocate a new string, otherwise, one would be able
>> to modify the contents of the immutable string via the char[] reference.
>
> and you don't want sneaky allocations creeping in. ok. tku.
>
> how about automatically checking code in examples?
I think this is the recommended mechanism for that:
http://dlang.org/unittest.html (documented unit tests)
More information about the Digitalmars-d-learn
mailing list