mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-10-26 03:37:26 +01:00
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
module aa3;
|
||||
|
||||
extern(C) int printf(char*, ...);
|
||||
alias char[] string;
|
||||
|
||||
void main()
|
||||
{
|
||||
int[string] aa;
|
||||
{aa["hello"] = 1;}
|
||||
{int* p = "" in aa;}
|
||||
aa[" worl"] = 2;
|
||||
aa["d"] = 3;
|
||||
aa["thisisgreat"] = 10;
|
||||
int sum;
|
||||
string cat;
|
||||
{
|
||||
foreach(k,v;aa)
|
||||
{
|
||||
printf("int[%.*s] = %d\n", k.length, k.ptr, v);
|
||||
sum += v;
|
||||
cat ~= k;
|
||||
}
|
||||
}
|
||||
assert(sum == 16);
|
||||
printf("cat = %.*s\n", cat.length, cat.ptr);
|
||||
assert(cat.length == 22);
|
||||
}
|
||||
Reference in New Issue
Block a user