diff --git a/std/getopt.d b/std/getopt.d index e4acdd4d9..536abe432 100755 --- a/std/getopt.d +++ b/std/getopt.d @@ -247,7 +247,7 @@ getopt(args, "bar", &bar); --------- -In the example above, "--foo", "--bar", "--FOo", "--bAr" etc. are recognized. The directive is active til the end of $(D_PARAM getopt), or until the converse directive $(D_PARAM caseSensitive) is encountered: +In the example above, "--foo", "--bar", "--FOo", "--bAr" etc. are recognized. The directive is active til the end of $(D_PARAM getopt), or until the converse directive $(D_PARAM caseInsensitive) is encountered: --------- bool foo, bar; diff --git a/std/metastrings.d b/std/metastrings.d index b76cfee1e..474846510 100644 --- a/std/metastrings.d +++ b/std/metastrings.d @@ -149,7 +149,7 @@ template ToString(char C) unittest { auto s = Format!("hel%slo", "world", -138, 'c', true); - // BUG 1616 filed: assert(s == "helworldlo-138ctrue"); + // BUG 1616 filed: assert(s == "helworldlo-138ctrue", "[" ~ s ~ "]"); } diff --git a/std/stdio.d b/std/stdio.d index f8bb2f628..726aed89f 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -243,6 +243,7 @@ unittest string file = "dmd-build-test.deleteme.txt"; FILE* f = fopen(file, "w"); assert(f, getcwd()); + scope(exit) { std.file.remove(file); } write(f, "Hello, ", "world number ", 42, "!"); fclose(f) == 0 || assert(false); assert(cast(char[]) std.file.read(file) == "Hello, world number 42!"); @@ -274,6 +275,7 @@ unittest string file = "dmd-build-test.deleteme.txt"; FILE* f = fopen(file, "w"); assert(f); + scope(exit) { std.file.remove(file); } writeln(f, "Hello, ", "world number ", 42, "!"); fclose(f) == 0 || assert(false); assert(cast(char[]) std.file.read(file) == "Hello, world number 42!\n"); @@ -366,6 +368,7 @@ unittest string file = "dmd-build-test.deleteme.txt"; auto f = fopen(file, "w"); assert(f); + scope(exit) { std.file.remove(file); } writef(f, "Hello, %s world number %s!", "nice", 42); fclose(f) == 0 || assert(false); assert(cast(char[]) std.file.read(file) == "Hello, nice world number 42!"); @@ -393,6 +396,7 @@ unittest string file = "dmd-build-test.deleteme.txt"; FILE* f = fopen(file, "w"); assert(f); + scope(exit) { std.file.remove(file); } writefln(f, "Hello, %s world number %s!", "nice", 42); fclose(f) == 0 || assert(false); assert(cast(char[]) std.file.read(file) == "Hello, nice world number 42!\n"); @@ -1058,6 +1062,7 @@ struct lines unittest { string file = "dmd-build-test.deleteme.txt"; + scope(exit) { std.file.remove(file); } alias TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[]) TestedWith; @@ -1244,6 +1249,7 @@ struct chunks unittest { string file = "dmd-build-test.deleteme.txt"; + scope(exit) { std.file.remove(file); } // test looping with an empty file std.file.write(file, ""); auto f = fopen(file, "r"); diff --git a/std/traits.d b/std/traits.d index 4f25132b7..a60e32b78 100644 --- a/std/traits.d +++ b/std/traits.d @@ -470,13 +470,13 @@ static assert (!isStaticArray!(const(int)[4][])); static assert (!isStaticArray!(int[])); static assert (!isStaticArray!(int[char])); static assert (!isStaticArray!(int[1][])); -static assert(isStaticArray!(invariant char[13u])); -static assert(isStaticArray!(void[0])); -static assert(!isStaticArray!(int[int])); -static assert(!isStaticArray!(int)); -static assert(isStaticArray!(const(real)[1])); -static assert(isStaticArray!(const(real)[1][1])); -static assert(isStaticArray!(typeof("string literal"))); +static assert (isStaticArray!(invariant char[13u])); +static assert (isStaticArray!(const(real)[1])); +static assert (isStaticArray!(const(real)[1][1])); +static assert (isStaticArray!(typeof("string literal"))); +static assert (isStaticArray!(void[0])); +static assert (!isStaticArray!(int[int])); +static assert (!isStaticArray!(int)); /** * Detect whether type T is a dynamic array. diff --git a/unittest.d b/unittest.d index 59ea46a48..fa2990b82 100644 --- a/unittest.d +++ b/unittest.d @@ -1,4 +1,3 @@ - /* * Copyright (C) 1999-2006 by Digital Mars, www.digitalmars.com * Written by Walter Bright @@ -26,33 +25,7 @@ // to run the unit tests on them. // Then, it prints out the arguments passed to main(). -import std.c.stdio; -import std.string; -import std.path; -import std.math; -import std.math2; -import std.outbuffer; -import std.ctype; -import std.regexp; -import std.random; -import std.date; -import std.dateparse; -import std.demangle; -import std.cstream; -import std.stream; -import std.utf; -import std.uri; -import std.zlib; -import std.md5; -import std.stdio; -import std.conv; -import std.boxer; -import std.bitarray; -import std.uni; -import std.file; -import std.signals; -import std.cpuid; -import std.socket; +import all_std_modules_generated; int main(char[][] args) {