add test for ctors not tainting fields

This commit is contained in:
WebFreak001 2023-08-11 16:42:29 +02:00 committed by Jan Jurzitza
parent 60ccfd520e
commit 8a693954d3
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,3 @@
identifiers
mangleof k
member1 v

19
tests/tc_ctors/file.d Normal file
View File

@ -0,0 +1,19 @@
struct Foo {
this(int mCtor) {}
int member1;
}
class Bar {
this(int mCtor) {}
int member1;
}
unittest {
Foo f;
f.m
}
unittest {
Bar b = new Bar(1);
b.m
}

8
tests/tc_ctors/run.sh Executable file
View File

@ -0,0 +1,8 @@
set -e
set -u
../../bin/dcd-client $1 file.d -c122 > actual.txt
diff actual.txt expected.txt --strip-trailing-cr
../../bin/dcd-client $1 file.d -c162 > actual.txt
diff actual.txt expected.txt --strip-trailing-cr