Unittest loop over first 32 control chars to ensure they are lined up.

This commit is contained in:
dukc 2019-05-17 14:30:57 +03:00
parent 778e307816
commit c36d609f01

View file

@ -146,9 +146,14 @@ enum ControlChar : char
///
@safe pure nothrow @nogc unittest
{
import std.algorithm.comparison, std.algorithm.searching, std.range, std.traits;
// Because all ASCII characters fit in char, so do these
static assert(ControlChar.ack.sizeof == 1);
// All control characters except del are in row starting from 0
static assert(EnumMembers!ControlChar.only.until(ControlChar.del).equal(iota(32)));
static assert(ControlChar.nul == '\0');
static assert(ControlChar.bel == '\a');
static assert(ControlChar.bs == '\b');