Field | Value |
---|---|
DIP: | (number/id -- assigned by DIP Manager) |
Author: | monkyyy, [email protected] |
Implementation: | (links to implementation PR if any) |
Status: | Draft |
Shortened unittest syntax
- Rationale
- Prior Work
- Description
- Breaking Changes and Deprecations
- Reference
- Copyright & License
- History
One-liner functions should at least have one line of tests.
Shortened function syntax.
Shortened contract syntax.
A module-level unittest statement( uses ()
instead of {}
) for single asserts
, with an optional string message
unittest(1==1);
unittest(1==1,"math broke");
TODO: Detailed technical description of the new semantics. Language grammar changes (per https://dlang.org/spec/grammar.html) needed to support the new syntax (or change) must be listed.
On-going debate if it effects future unittest syntax
https://forum.dlang.org/thread/[email protected]
https://forum.dlang.org/thread/[email protected]
Copyright (c) 2024 by the D Language Foundation
Licensed under Creative Commons Zero 1.0
The DIP Manager will supplement this section with links to forum discsusionss and a summary of the formal assessment.
adr is in favor of
unittest=>1==1;
walters suggestion about "argument unittests" being blocked still seems wrong to me and he never responded to my code block about template unittests; I believe that all unittests must be compile time and therefore probably templated