mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 15:40:36 +03:00
Add asserts for the "compiles" tests
This commit is contained in:
parent
c17a621bf2
commit
75cbbef0ab
9 changed files with 52 additions and 17 deletions
|
@ -377,7 +377,7 @@ unittest
|
|||
import std.typecons;
|
||||
static assert(!__traits(compiles, [ tuple("foo", "bar", "baz") ].assocArray()));
|
||||
static assert(!__traits(compiles, [ tuple("foo") ].assocArray()));
|
||||
[ tuple("foo", "bar") ].assocArray();
|
||||
assert([ tuple("foo", "bar") ].assocArray() == ["foo": "bar"]);
|
||||
}
|
||||
|
||||
// Issue 13909
|
||||
|
@ -386,7 +386,7 @@ unittest
|
|||
import std.typecons;
|
||||
auto a = [tuple!(const string, string)("foo", "bar")];
|
||||
auto b = [tuple!(string, const string)("foo", "bar")];
|
||||
assocArray(a);
|
||||
assert(assocArray(a) == [cast(const(string)) "foo": "bar"]);
|
||||
static assert(!__traits(compiles, assocArray(b)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue