From 9850217828500246c77c5a987c589fe3ad895620 Mon Sep 17 00:00:00 2001 From: ryuukk Date: Thu, 9 Feb 2023 03:45:35 +0100 Subject: [PATCH] added test --- tests/tc_auto_cast/expected.txt | 2 ++ tests/tc_auto_cast/file.d | 18 ++++++++++++++++++ tests/tc_auto_cast/run.sh | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 tests/tc_auto_cast/expected.txt create mode 100644 tests/tc_auto_cast/file.d create mode 100644 tests/tc_auto_cast/run.sh diff --git a/tests/tc_auto_cast/expected.txt b/tests/tc_auto_cast/expected.txt new file mode 100644 index 0000000..2774d5f --- /dev/null +++ b/tests/tc_auto_cast/expected.txt @@ -0,0 +1,2 @@ +identifiers +from_cast v C from_cast stdin 165 diff --git a/tests/tc_auto_cast/file.d b/tests/tc_auto_cast/file.d new file mode 100644 index 0000000..a1d7086 --- /dev/null +++ b/tests/tc_auto_cast/file.d @@ -0,0 +1,18 @@ +struct A +{ + struct B + { + struct C + { + int inside_c; + } + int inside_b; + } + int inside_a; +} + +void main() +{ + auto from_cast = cast(A.B.C) A(); + from_ca +} diff --git a/tests/tc_auto_cast/run.sh b/tests/tc_auto_cast/run.sh new file mode 100644 index 0000000..4404540 --- /dev/null +++ b/tests/tc_auto_cast/run.sh @@ -0,0 +1,5 @@ +set -e +set -u + +../../bin/dcd-client $1 file.d --extended -c154 > actual.txt +diff actual.txt expected.txt --strip-trailing-cr