Skip to content

Commit

Permalink
Merge pull request #4496 from atilaneves/safe_std_ascii
Browse files Browse the repository at this point in the history
Add @safe to std.ascii unittests
  • Loading branch information
dnadlinger committed Jun 29, 2016
2 parents b54a972 + a4a8174 commit 9689cd6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions std/ascii.d
Expand Up @@ -78,7 +78,7 @@ bool isAlphaNum(dchar c) @safe pure nothrow @nogc
assert(!isAlphaNum('á'));
}

unittest
@safe unittest
{
foreach (c; chain(digits, octalDigits, fullHexDigits, letters, lowercase, uppercase))
assert(isAlphaNum(c));
Expand Down Expand Up @@ -109,7 +109,7 @@ bool isAlpha(dchar c) @safe pure nothrow @nogc
assert(!isAlpha('á'));
}

unittest
@safe unittest
{
foreach (c; chain(letters, lowercase, uppercase))
assert(isAlpha(c));
Expand Down Expand Up @@ -140,7 +140,7 @@ bool isLower(dchar c) @safe pure nothrow @nogc
assert(!isLower('Á'));
}

unittest
@safe unittest
{
foreach (c; lowercase)
assert(isLower(c));
Expand Down Expand Up @@ -171,7 +171,7 @@ bool isUpper(dchar c) @safe pure nothrow @nogc
assert(!isUpper('Á'));
}

unittest
@safe unittest
{
foreach (c; uppercase)
assert(isUpper(c));
Expand Down Expand Up @@ -203,7 +203,7 @@ bool isDigit(dchar c) @safe pure nothrow @nogc
assert(!isDigit('')); // full-width digit four (U+FF14)
}

unittest
@safe unittest
{
foreach (c; digits)
assert(isDigit(c));
Expand Down Expand Up @@ -232,7 +232,7 @@ bool isOctalDigit(dchar c) @safe pure nothrow @nogc
assert(!isOctalDigit('#'));
}

unittest
@safe unittest
{
foreach (c; octalDigits)
assert(isOctalDigit(c));
Expand Down Expand Up @@ -262,7 +262,7 @@ bool isHexDigit(dchar c) @safe pure nothrow @nogc
assert(!isHexDigit('#'));
}

unittest
@safe unittest
{
foreach (c; fullHexDigits)
assert(isHexDigit(c));
Expand Down Expand Up @@ -299,7 +299,7 @@ bool isWhite(dchar c) @safe pure nothrow @nogc
assert(!isWhite('\u00A0')); // std.ascii.isWhite
}

unittest
@safe unittest
{
foreach (c; whitespace)
assert(isWhite(c));
Expand Down Expand Up @@ -335,7 +335,7 @@ bool isControl(dchar c) @safe pure nothrow @nogc
assert(!isControl('\u2029'));
}

unittest
@safe unittest
{
foreach (dchar c; 0 .. 32)
assert(isControl(c));
Expand Down Expand Up @@ -379,7 +379,7 @@ bool isPunctuation(dchar c) @safe pure nothrow @nogc
assert(!isPunctuation('\u2012')); // (U+2012 = en-dash)
}

unittest
@safe unittest
{
foreach (dchar c; 0 .. 128)
{
Expand Down Expand Up @@ -415,7 +415,7 @@ bool isGraphical(dchar c) @safe pure nothrow @nogc
assert(!isGraphical('á'));
}

unittest
@safe unittest
{
foreach (dchar c; 0 .. 128)
{
Expand Down Expand Up @@ -450,7 +450,7 @@ bool isPrintable(dchar c) @safe pure nothrow @nogc
assert(!isPrintable('á'));
}

unittest
@safe unittest
{
foreach (dchar c; 0 .. 128)
{
Expand Down Expand Up @@ -480,7 +480,7 @@ bool isASCII(dchar c) @safe pure nothrow @nogc
assert(!isASCII('á'));
}

unittest
@safe unittest
{
foreach (dchar c; 0 .. 128)
assert(isASCII(c));
Expand Down Expand Up @@ -612,7 +612,7 @@ auto toUpper(C)(C c)
}


unittest //Test both toUpper and toLower with non-builtin
@safe unittest //Test both toUpper and toLower with non-builtin
{
//User Defined [Char|Wchar|Dchar]
static struct UDC { char c; alias c this; }
Expand Down

0 comments on commit 9689cd6

Please sign in to comment.