Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2064 from aG0aep6G/16739
Browse files Browse the repository at this point in the history
add test for issue 16739 - switch ignores case
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Jan 28, 2018
2 parents bc75aa0 + efc7377 commit 2411c52
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/object.d
Expand Up @@ -4000,6 +4000,19 @@ unittest
assert(binarySearch("") == -1);
assert(binarySearch("sth.") == -1);
assert(binarySearch(null) == -1);

static int bug16739(immutable(T)[] s)
{
switch (s)
{
case "\u0100": return 1;
case "a": return 2;
default: return 3;
}
}
assert(bug16739("\u0100") == 1);
assert(bug16739("a") == 2);
assert(bug16739("foo") == 3);
}
testSwitch!char;
testSwitch!wchar;
Expand Down

0 comments on commit 2411c52

Please sign in to comment.