Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion std/algorithm/internal.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package template algoFormat()
}

// Internal random array generators
version(unittest)
version(StdUnittest)
{
package enum size_t maxArraySize = 50;
package enum size_t minArraySize = maxArraySize - 1;
Expand Down
4 changes: 2 additions & 2 deletions std/algorithm/sorting.d
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range)
for (;;)
{
// Loop invariant
version(unittest)
version(StdUnittest)
{
import std.algorithm.searching : all;
assert(r[0 .. lo].all!(x => !lt(p, x)));
Expand Down Expand Up @@ -3439,7 +3439,7 @@ done:
a.length / 2 + 1);
}

version(unittest)
version(StdUnittest)
private T[] randomArray(Flag!"exactSize" flag = No.exactSize, T = int)(
size_t maxSize = 1000,
T minValue = 0, T maxValue = 255)
Expand Down
4 changes: 2 additions & 2 deletions std/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ private template blockAttribute(T)
enum blockAttribute = GC.BlkAttr.NO_SCAN;
}
}
version(unittest)
version(StdUnittest)
{
import core.memory : UGC = GC;
static assert(!(blockAttribute!void & UGC.BlkAttr.NO_SCAN));
Expand All @@ -569,7 +569,7 @@ private template nDimensions(T)
}
}

version(unittest)
version(StdUnittest)
{
static assert(nDimensions!(uint[]) == 1);
static assert(nDimensions!(float[][]) == 2);
Expand Down
2 changes: 1 addition & 1 deletion std/ascii.d
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $(TR $(TD Enums) $(TD
+/
module std.ascii;

version (unittest)
version(StdUnittest)
{
// FIXME: When dmd bug #314 is fixed, make these selective.
import std.meta; // : AliasSeq;
Expand Down
2 changes: 1 addition & 1 deletion std/bitmanip.d
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import std.range.primitives;
public import std.system : Endian;
import std.traits;

version(unittest)
version(StdUnittest)
{
import std.stdio;
}
Expand Down
2 changes: 1 addition & 1 deletion std/concurrency.d
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,7 @@ private
}
}

version (unittest)
version(StdUnittest)
{
import std.stdio;
import std.typecons : tuple, Tuple;
Expand Down
4 changes: 2 additions & 2 deletions std/container/rbtree.d
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import std.functional : binaryFun;

public import std.container.util;

version(unittest) debug = RBDoChecks;
version(StdUnittest) debug = RBDoChecks;

//debug = RBDoChecks;

Expand Down Expand Up @@ -745,7 +745,7 @@ if (is(typeof(binaryFun!less(T.init, T.init))))

alias _less = binaryFun!less;

version(unittest)
version(StdUnittest)
{
static if (is(typeof(less) == string))
{
Expand Down
6 changes: 3 additions & 3 deletions std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -4882,7 +4882,7 @@ if (!is(T == class))
assert(u1.a == "hello");
}

version(unittest) private struct __conv_EmplaceTest
version(StdUnittest) private struct __conv_EmplaceTest
{
int i = 3;
this(int i)
Expand All @@ -4903,7 +4903,7 @@ version(unittest) private struct __conv_EmplaceTest
void opAssign();
}

version(unittest) private class __conv_EmplaceTestClass
version(StdUnittest) private class __conv_EmplaceTestClass
{
int i = 3;
this(int i) @nogc @safe pure nothrow
Expand Down Expand Up @@ -5323,7 +5323,7 @@ version(unittest) private class __conv_EmplaceTestClass
assert(s.i == 2);
}
}
version(unittest)
version(StdUnittest)
{
//Ambiguity
struct __std_conv_S
Expand Down
4 changes: 2 additions & 2 deletions std/datetime/date.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import std.traits : isSomeString, Unqual;
import std.typecons : Flag;
import std.range.primitives : isOutputRange;

version(unittest) import std.exception : assertThrown;
version(StdUnittest) import std.exception : assertThrown;

@safe unittest
{
Expand Down Expand Up @@ -10272,7 +10272,7 @@ if (isSomeString!T)
}


version(unittest)
version(StdUnittest)
{
// All of these helper arrays are sorted in ascending order.
auto testYearsBC = [-1999, -1200, -600, -4, -1, 0];
Expand Down
2 changes: 1 addition & 1 deletion std/datetime/interval.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import std.exception : enforce;
import std.traits : isIntegral, Unqual;
import std.typecons : Flag;

version(unittest) import std.exception : assertThrown;
version(StdUnittest) import std.exception : assertThrown;


/++
Expand Down
8 changes: 4 additions & 4 deletions std/datetime/systime.d
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else version(Posix)
import core.sys.posix.sys.types : time_t;
}

version(unittest)
version(StdUnittest)
{
import core.exception : AssertError;
import std.exception : assertThrown;
Expand Down Expand Up @@ -9699,7 +9699,7 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
assertThrown!DateTimeException(parseRFC822DateTime(badStr));
}

version(unittest) void testParse822(alias cr)(string str, SysTime expected, size_t line = __LINE__)
version(StdUnittest) void testParse822(alias cr)(string str, SysTime expected, size_t line = __LINE__)
{
import std.format : format;
auto value = cr(str);
Expand All @@ -9708,7 +9708,7 @@ version(unittest) void testParse822(alias cr)(string str, SysTime expected, size
throw new AssertError(format("wrong result. expected [%s], actual[%s]", expected, result), __FILE__, line);
}

version(unittest) void testBadParse822(alias cr)(string str, size_t line = __LINE__)
version(StdUnittest) void testBadParse822(alias cr)(string str, size_t line = __LINE__)
{
try
parseRFC822DateTime(cr(str));
Expand Down Expand Up @@ -10636,7 +10636,7 @@ if (isIntegral!T && isSigned!T) // The constraints on R were already covered by
}


version(unittest)
version(StdUnittest)
{
// Variables to help in testing.
Duration currLocalDiffFromUTC;
Expand Down
2 changes: 1 addition & 1 deletion std/datetime/timezone.d
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else version(Posix)
import core.sys.posix.sys.types : time_t;
}

version(unittest) import std.exception : assertThrown;
version(StdUnittest) import std.exception : assertThrown;


/++
Expand Down
3 changes: 1 addition & 2 deletions std/digest/crc.d
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ module std.digest.crc;

public import std.digest;

version(unittest)
import std.exception;
version(StdUnittest) import std.exception;


///
Expand Down
2 changes: 1 addition & 1 deletion std/digest/hmac.d
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ if (isDigest!H)
}
}

version(unittest)
version(StdUnittest)
{
import std.digest : toHexString, LetterCase;
alias hex = toHexString!(LetterCase.lower);
Expand Down
2 changes: 1 addition & 1 deletion std/digest/murmurhash.d
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ L_end:
}
}

version (unittest)
version(StdUnittest)
{
import std.string : representation;

Expand Down
2 changes: 1 addition & 1 deletion std/digest/sha.d
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ else version(D_InlineAsm_X86_64)
version(LittleEndian) import core.bitop : bswap;


version(unittest)
version(StdUnittest)
{
import std.exception;
}
Expand Down
2 changes: 1 addition & 1 deletion std/encoding.d
Original file line number Diff line number Diff line change
Expand Up @@ -3634,7 +3634,7 @@ class EncodingSchemeUtf32Native : EncodingScheme


// Helper functions
version(unittest)
version(StdUnittest)
{
void transcodeReverse(Src,Dst)(immutable(Src)[] s, out immutable(Dst)[] r)
{
Expand Down
2 changes: 1 addition & 1 deletion std/exception.d
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ CommonType!(T1, T2) ifThrown(T1, T2)(lazy scope T1 expression, scope T2 delegate
static assert(!__traits(compiles, (new Object()).ifThrown(e=>1)));
}

version(unittest) package
version(StdUnittest) package
@property void assertCTFEable(alias dg)()
{
static assert({ cast(void) dg(); return true; }());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module std.experimental.allocator.building_blocks.allocator_list;
import std.experimental.allocator.building_blocks.null_allocator;
import std.experimental.allocator.common;
import std.experimental.allocator.gc_allocator;
version(unittest) import std.stdio;
version(StdUnittest) import std.stdio;

// Turn this on for debugging
// debug = allocator_list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ else
}
}

version (StdUnittest)
version(StdUnittest)
{
static void testrw(void[] b) @nogc nothrow
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module std.experimental.allocator.building_blocks.kernighan_ritchie;
import std.experimental.allocator.building_blocks.null_allocator;

//debug = KRRegion;
version(unittest) import std.conv : text;
version(StdUnittest) import std.conv : text;
debug(KRRegion) import std.stdio;

// KRRegion
Expand Down
2 changes: 1 addition & 1 deletion std/experimental/allocator/common.d
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ Forwards each of the methods in `funs` (if defined) to `member`.
return result;
}

version(unittest)
version(StdUnittest)
{
import std.experimental.allocator : RCIAllocator, RCISharedAllocator;

Expand Down
2 changes: 1 addition & 1 deletion std/experimental/allocator/mallocator.d
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ struct AlignedMallocator
//...
}

version(unittest) version(CRuntime_DigitalMars)
version(StdUnittest) version(CRuntime_DigitalMars)
@nogc nothrow
size_t addr(ref void* ptr) { return cast(size_t) ptr; }

Expand Down
2 changes: 1 addition & 1 deletion std/experimental/allocator/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ if (isInputRange!R && !isInfinite!R)
assert(arr2.map!`a.val`.equal(iota(32, 204, 2)));
}

version(unittest)
version(StdUnittest)
{
private struct ForcedInputRange
{
Expand Down
2 changes: 1 addition & 1 deletion std/experimental/logger/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ package class TestLogger : Logger
}
}

version(unittest) private void testFuncNames(Logger logger) @safe
version(StdUnittest) private void testFuncNames(Logger logger) @safe
{
string s = "I'm here";
logger.log(s);
Expand Down
4 changes: 2 additions & 2 deletions std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ else
return _deleteme;
}

version (unittest) private struct TestAliasedString
version(StdUnittest) private struct TestAliasedString
{
string get() @safe @nogc pure nothrow { return _s; }
alias get this;
Expand Down Expand Up @@ -2655,7 +2655,7 @@ version(Windows) string getcwd()
3. the buffer (lpBuffer) is not large enough: the required size of
the buffer, in characters, including the null-terminating character.
*/
version (StdUnittest)
version(StdUnittest)
enum BUF_SIZE = 10; // trigger reallocation code
else
enum BUF_SIZE = 4096; // enough for most common case
Expand Down
12 changes: 6 additions & 6 deletions std/format.d
Original file line number Diff line number Diff line change
Expand Up @@ -4344,7 +4344,7 @@ private T getNth(string kind, alias Condition, T, A...)(uint index, A args)

/* ======================== Unit Tests ====================================== */

version(unittest)
version(StdUnittest)
void formatTest(T)(T val, string expected, size_t ln = __LINE__, string fn = __FILE__)
{
import core.exception : AssertError;
Expand All @@ -4358,7 +4358,7 @@ void formatTest(T)(T val, string expected, size_t ln = __LINE__, string fn = __F
text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln);
}

version(unittest)
version(StdUnittest)
void formatTest(T)(string fmt, T val, string expected, size_t ln = __LINE__, string fn = __FILE__) @safe
{
import core.exception : AssertError;
Expand All @@ -4371,7 +4371,7 @@ void formatTest(T)(string fmt, T val, string expected, size_t ln = __LINE__, str
text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln);
}

version(unittest)
version(StdUnittest)
void formatTest(T)(T val, string[] expected, size_t ln = __LINE__, string fn = __FILE__)
{
import core.exception : AssertError;
Expand All @@ -4389,7 +4389,7 @@ void formatTest(T)(T val, string[] expected, size_t ln = __LINE__, string fn = _
text("expected one of `", expected, "`, result = `", w.data, "`"), fn, ln);
}

version(unittest)
version(StdUnittest)
void formatTest(T)(string fmt, T val, string[] expected, size_t ln = __LINE__, string fn = __FILE__) @safe
{
import core.exception : AssertError;
Expand Down Expand Up @@ -4871,7 +4871,7 @@ here:
assert(a == "hello" && b == 124 && c == 34.5);
}

version(unittest)
version(StdUnittest)
void formatReflectTest(T)(ref T val, string fmt, string formatted, string fn = __FILE__, size_t ln = __LINE__)
{
import core.exception : AssertError;
Expand Down Expand Up @@ -4913,7 +4913,7 @@ void formatReflectTest(T)(ref T val, string fmt, string formatted, string fn = _
input, fn, ln);
}

version(unittest)
version(StdUnittest)
void formatReflectTest(T)(ref T val, string fmt, string[] formatted, string fn = __FILE__, size_t ln = __LINE__)
{
import core.exception : AssertError;
Expand Down
2 changes: 1 addition & 1 deletion std/internal/cstring.d
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private:

To* _ptr;
size_t _length; // length of the string
version (StdUnittest)
version(StdUnittest)
// the 'small string optimization'
{
// smaller size to trigger reallocations. Padding is to account for
Expand Down
2 changes: 1 addition & 1 deletion std/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ else version (X86)
private alias haveSSE = core.cpuid.sse;
}

version(unittest)
version(StdUnittest)
{
import core.stdc.stdio; // : sprintf;

Expand Down
Loading