mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 14:40:30 +03:00
Reduced tr unittest to keep test time under control
This commit is contained in:
parent
0bf4ed8728
commit
cb3e372eb7
1 changed files with 13 additions and 9 deletions
22
std/string.d
22
std/string.d
|
@ -3044,17 +3044,21 @@ unittest
|
||||||
debug(string) printf("std.string.tr.unittest\n");
|
debug(string) printf("std.string.tr.unittest\n");
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
|
|
||||||
foreach(S; TypeTuple!(char[], const(char)[], immutable(char)[],
|
// Complete list of test types; too slow to test'em all
|
||||||
wchar[], const(wchar)[], immutable(wchar)[],
|
// alias TypeTuple!(char[], const(char)[], immutable(char)[],
|
||||||
dchar[], const(dchar)[], immutable(dchar)[]))
|
// wchar[], const(wchar)[], immutable(wchar)[],
|
||||||
|
// dchar[], const(dchar)[], immutable(dchar)[])
|
||||||
|
// TestTypes;
|
||||||
|
|
||||||
|
// Reduced list of test types
|
||||||
|
alias TypeTuple!(char[], const(wchar)[], immutable(dchar)[])
|
||||||
|
TestTypes;
|
||||||
|
|
||||||
|
foreach(S; TestTypes)
|
||||||
{
|
{
|
||||||
foreach(T; TypeTuple!(char[], const(char)[], immutable(char)[],
|
foreach(T; TestTypes)
|
||||||
wchar[], const(wchar)[], immutable(wchar)[],
|
|
||||||
dchar[], const(dchar)[], immutable(dchar)[]))
|
|
||||||
{
|
{
|
||||||
foreach(U; TypeTuple!(char[], const(char)[], immutable(char)[],
|
foreach(U; TestTypes)
|
||||||
wchar[], const(wchar)[], immutable(wchar)[],
|
|
||||||
dchar[], const(dchar)[], immutable(dchar)[]))
|
|
||||||
{
|
{
|
||||||
assert(equal(tr(to!S("abcdef"), to!T("cd"), to!U("CD")), "abCDef"));
|
assert(equal(tr(to!S("abcdef"), to!T("cd"), to!U("CD")), "abCDef"));
|
||||||
assert(equal(tr(to!S("abcdef"), to!T("b-d"), to!U("B-D")), "aBCDef"));
|
assert(equal(tr(to!S("abcdef"), to!T("b-d"), to!U("B-D")), "aBCDef"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue