mirror of
https://github.com/dlang-community/DCD.git
synced 2025-04-25 21:00:02 +03:00
add test for ctors not tainting fields
This commit is contained in:
parent
60ccfd520e
commit
8a693954d3
3 changed files with 30 additions and 0 deletions
3
tests/tc_ctors/expected.txt
Normal file
3
tests/tc_ctors/expected.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
identifiers
|
||||
mangleof k
|
||||
member1 v
|
19
tests/tc_ctors/file.d
Normal file
19
tests/tc_ctors/file.d
Normal 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
8
tests/tc_ctors/run.sh
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue