Static unittests?
monarch_dodra
monarchdodra at gmail.com
Mon Aug 5 10:38:21 PDT 2013
On Monday, 5 August 2013 at 17:15:34 UTC, Dicebot wrote:
> On Monday, 5 August 2013 at 16:50:12 UTC, monarch_dodra wrote:
>> This is currently "package", but it proves that what you asked
>> for is not only possible, it is implemented *and* used in
>> phobos.
>
> topic-starter has been asking about _language_ feature and my
> answer was related to this possible _language_ feature.
> Existence of some template in Phobos does not prove anything
> here.
Well, it's not about *proving* anything :/
Technically, the question asked was: "Are compile-time unittests
possible in D?", so I'm not even sure the question *was* strictly
about language.
But even if someone asks if a "language" can *do* something you
*have* to take into account what the library can do. For example,
D doesn't have "native" octals because they are library
implemented. Does this mean that "D doesn't have octals" ?
So sure, I guess that strictly speaking, no, D language doesn't
have static unittests. However, when someone asks the question,
if you just answer "No" without pointing out that the language
allows this semantic:
version(unittest) assertCTFEAble!({
//YOUR CODE HERE
});
Then I believe you are giving an incomplete answer.
More information about the Digitalmars-d
mailing list