From c36d609f0113a73f3ebce0b43c2d2dbfb6faa8bc Mon Sep 17 00:00:00 2001 From: dukc Date: Fri, 17 May 2019 14:30:57 +0300 Subject: [PATCH] Unittest loop over first 32 control chars to ensure they are lined up. --- std/ascii.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/std/ascii.d b/std/ascii.d index 07f4a6a00..847466e63 100644 --- a/std/ascii.d +++ b/std/ascii.d @@ -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');