diff options
author | sagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8> | 2009-06-06 15:16:25 (GMT) |
---|---|---|
committer | sagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8> | 2009-06-06 15:16:25 (GMT) |
commit | 75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a (patch) | |
tree | 79d0064b694da77fbc9a44a256ba1333513e1466 /test/cvtest.d | |
parent | 5f8ec64d826f844ccc5e5f5b8767545e305a6e81 (diff) | |
download | cv2pdb-75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a.zip cv2pdb-75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a.tar.gz cv2pdb-75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a.tar.bz2 |
v0.5:
* fixed error in __viewhelper field of string type, that could screw up type info
* added support for wstring and dstring
* fixed problems with debug info inside library by combining debug info of different modules into a single pseudo-module
* now also replaces '.' by '@' in enumerator types for more consistent debug info
Diffstat (limited to 'test/cvtest.d')
-rw-r--r-- | test/cvtest.d | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/test/cvtest.d b/test/cvtest.d index c978f03..c5b80a1 100644 --- a/test/cvtest.d +++ b/test/cvtest.d @@ -1,12 +1,14 @@ module cvtest;
+import std.string;
+import std.stdio;
///////////////// field types ////////////////////////
// field type LF_ENUMERATE_V1
enum enum_name
{
- kEnum1,
+ kEnum1 = 1,
kEnum2,
kEnum3,
kEnum500 = 500,
@@ -125,13 +127,16 @@ class Templ(T) }
}
-enum stringMixin = "int a = 0;
-return x + a;
-";
-
-int mixinTest(int x)
+version(D2)
{
- mixin(stringMixin);
+ string stringMixin = "int a = 0;
+ return x + a;
+ ";
+
+ int mixinTest(int x)
+ {
+ mixin(stringMixin);
+ }
}
int main2(char[][]argv)
@@ -180,6 +185,8 @@ int main(char[][]argv) main2(argv);
+ writefln("Hello world");
+
int[int] int_arr;
int_arr[1] = 100;
int_arr[98] = 101;
@@ -200,18 +207,22 @@ int main(char[][]argv) struc_arr[ab2] = 6;
struc_arr[ab3] = 7;
- Templ!(int) templ = new Templ!(int);
- int y = templ.foo(3);
- int z = mixinTest(7);
+ Templ!(int) templ = new Templ!(int);
+ int y = templ.foo(3);
+ version(D2)
+ int z = mixinTest(7);
- (new Test).test();
+ (new Test).test();
+
+ dmd_quirks();
+ strings();
int[] dynint_arr;
dynint_arr ~= 12;
return dynint_arr.length;
}
-alias invariant(char)[] string;
+// alias invariant(char)[] string;
class Test
{
@@ -231,3 +242,18 @@ class Test return dyn_arr.length + assoc_arr.length + clss.c;
}
}
+
+int strings()
+{
+ string cs = "char string";
+ wstring ws = "wchar string"w;
+ dstring ds = "dchar string"d;
+
+ return 0;
+}
+
+void dmd_quirks()
+{
+ long quirk_long; // written as delegate<void*,int>
+ ulong quirk_ulong; // written as int[]
+}
|