Skip to content

Commit

Permalink
Add more std.traits.packageName unittests
Browse files Browse the repository at this point in the history
* some of the unittests are commented out because of the Issue 8922
* Issue 8922 URL: http://d.puremagic.com/issues/show_bug.cgi?id=8922
  • Loading branch information
denis-sh committed Oct 31, 2012
1 parent 303ca7c commit f173f98
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions std/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,24 @@ template packageName(alias T)

unittest
{
static assert(packageName!packageName == "std");
// Commented out because of dmd @@@BUG8922@@@
// static assert(packageName!std == "std"); // this package (currently: "std.std")
static assert(packageName!(std.traits) == "std"); // this module
static assert(packageName!packageName == "std"); // symbol in this module
static assert(packageName!(std.algorithm) == "std"); // other module from same package

import etc.c.curl; // local import
static assert(packageName!etc == "etc");
static assert(packageName!(etc.c) == "etc.c");
static assert(packageName!curl_httppost == "etc.c");
}

import etc.c.curl;
version(unittest)
{
import etc.c.curl; // global import
// Commented out because of dmd @@@BUG8922@@@
// static assert(packageName!etc == "etc"); // (currently: "std.etc")
static assert(packageName!(etc.c) == "etc.c");
static assert(packageName!curl_httppost == "etc.c");
}

Expand Down

0 comments on commit f173f98

Please sign in to comment.