Skip to content

Commit

Permalink
Fixed unittests to include original, proper, test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapps committed Feb 14, 2014
1 parent 23f292c commit 467d5d6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions std/variant.d
Expand Up @@ -1720,7 +1720,6 @@ unittest
class EmptyClass { }
struct EmptyStruct { }
alias EmptyArray = void[0];

alias Alg = Algebraic!(EmptyClass, EmptyStruct, EmptyArray);

Variant testEmpty(T)()
Expand All @@ -1739,9 +1738,11 @@ unittest
testEmpty!EmptyStruct();
testEmpty!EmptyArray();

EmptyArray e = EmptyArray.init;
Variant v2 = e;
assert(v2.length == 0);
// EmptyClass/EmptyStruct sizeof is 1, so we have this to test just size 0.
EmptyArray arr = EmptyArray.init;
Algebraic!(EmptyArray) a = arr;
assert(a.length == 0);
assert(a.get!EmptyArray == arr);
}

// Handling of void function pointers / delegates, e.g. issue 11360
Expand Down

0 comments on commit 467d5d6

Please sign in to comment.