From 5ff0b74550e70c8b1416b1a3bca07c349a9c2126 Mon Sep 17 00:00:00 2001 From: davu Date: Sun, 23 Oct 2022 10:17:46 +0200 Subject: [PATCH] adding test for ufcs fundamental types --- .../file.d | 24 +++++++++ .../run.sh | 52 +++++++++++++++++++ .../test_bool_expected.txt | 9 ++++ .../test_byte_expected.txt | 9 ++++ .../test_cdouble_expected.txt | 18 +++++++ .../test_cent_expected.txt | 18 +++++++ .../test_cfloat_expected.txt | 18 +++++++ .../test_char_expected.txt | 9 ++++ .../test_creal_expected.txt | 18 +++++++ .../test_dchar_expected.txt | 9 ++++ .../test_double_expected.txt | 18 +++++++ .../test_float_expected.txt | 18 +++++++ .../test_idouble_expected.txt | 20 +++++++ .../test_ifloat_expected.txt | 20 +++++++ .../test_int_expected.txt | 9 ++++ .../test_ireal_expected.txt | 20 +++++++ .../test_long_expected.txt | 9 ++++ .../test_real_expected.txt | 18 +++++++ .../test_short_expected.txt | 2 + .../test_ubyte_expected.txt | 9 ++++ .../test_ucent_expected.txt | 18 +++++++ .../test_uint_expected.txt | 9 ++++ .../test_ulong_expected.txt | 9 ++++ .../test_ushort_expected.txt | 9 ++++ .../test_void_expected.txt | 0 .../test_wchar_expected.txt | 9 ++++ .../expected.txt | 0 .../file.d | 0 .../fooutils/fooutils.d | 3 +- .../run.sh | 2 +- 30 files changed, 383 insertions(+), 3 deletions(-) create mode 100644 tests/tc_ufcs_fundamental_types_completion/file.d create mode 100755 tests/tc_ufcs_fundamental_types_completion/run.sh create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_bool_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_byte_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_cdouble_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_cent_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_cfloat_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_char_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_creal_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_dchar_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_double_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_float_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_idouble_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_ifloat_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_int_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_ireal_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_long_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_real_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_short_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_ubyte_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_ucent_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_uint_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_ulong_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_ushort_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_void_expected.txt create mode 100644 tests/tc_ufcs_fundamental_types_completion/test_wchar_expected.txt rename tests/{tc_ufcs_completions => tc_ufcs_struct_completion}/expected.txt (100%) rename tests/{tc_ufcs_completions => tc_ufcs_struct_completion}/file.d (100%) rename tests/{tc_ufcs_completions => tc_ufcs_struct_completion}/fooutils/fooutils.d (84%) rename tests/{tc_ufcs_completions => tc_ufcs_struct_completion}/run.sh (63%) diff --git a/tests/tc_ufcs_fundamental_types_completion/file.d b/tests/tc_ufcs_fundamental_types_completion/file.d new file mode 100644 index 0000000..e41cf29 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/file.d @@ -0,0 +1,24 @@ +void someBool(bool x){x.} +void someByte(byte x){x.} +void someUbyte(ubyte x){x.} +void someShort(short x){x.} +void someUshort(ushort x){x.} +void someInt(int x){x.} +void someUint(uint x){x.} +void someLong(long x){x.} +void someUlong(ulong x){x.} +void someCent(cent x){x.} +void someUcent(ucent x){x.} +void someChar(char x){x.} +void someWchar(wchar x){x.} +void someDchar(dchar x){x.} +void someFloat(float x){x.} +void someDouble(double x){x.} +void someReal(real x){x.} +void someIfloat(ifloat x){x.} +void someIdouble(idouble x){x.} +void someIreal(ireal x){x.} +void someCfloat(cfloat x){x.} +void someCdouble(cdouble x){x.} +void someCreal(creal x){x.} +void someVoid(void x){x.} \ No newline at end of file diff --git a/tests/tc_ufcs_fundamental_types_completion/run.sh b/tests/tc_ufcs_fundamental_types_completion/run.sh new file mode 100755 index 0000000..4e63226 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/run.sh @@ -0,0 +1,52 @@ +set -e +set -u + +../../bin/dcd-client $1 -c24 file.d > test_bool_actual.txt +../../bin/dcd-client $1 -c50 file.d > test_byte_actual.txt +../../bin/dcd-client $1 -c78 file.d > test_ubyte_actual.txt +../../bin/dcd-client $1 -c105 file.d > test_short_actual.txt +../../bin/dcd-client $1 -c136 file.d > test_ushort_actual.txt +../../bin/dcd-client $1 -c160 file.d > test_int_actual.txt +../../bin/dcd-client $1 -c186 file.d > test_uint_actual.txt +../../bin/dcd-client $1 -c212 file.d > test_long_actual.txt +../../bin/dcd-client $1 -c240 file.d > test_ulong_actual.txt +../../bin/dcd-client $1 -c266 file.d > test_cent_actual.txt +../../bin/dcd-client $1 -c294 file.d > test_ucent_actual.txt +../../bin/dcd-client $1 -c320 file.d > test_char_actual.txt +../../bin/dcd-client $1 -c348 file.d > test_wchar_actual.txt +../../bin/dcd-client $1 -c376 file.d > test_dchar_actual.txt +../../bin/dcd-client $1 -c404 file.d > test_float_actual.txt +../../bin/dcd-client $1 -c434 file.d > test_double_actual.txt +../../bin/dcd-client $1 -c460 file.d > test_real_actual.txt +../../bin/dcd-client $1 -c490 file.d > test_ifloat_actual.txt +../../bin/dcd-client $1 -c522 file.d > test_idouble_actual.txt +../../bin/dcd-client $1 -c550 file.d > test_ireal_actual.txt +../../bin/dcd-client $1 -c580 file.d > test_cfloat_actual.txt +../../bin/dcd-client $1 -c612 file.d > test_cdouble_actual.txt +../../bin/dcd-client $1 -c640 file.d > test_creal_actual.txt +../../bin/dcd-client $1 -c666 file.d > test_void_actual.txt + +diff test_bool_actual.txt test_bool_expected.txt +diff test_byte_actual.txt test_byte_expected.txt +diff test_ubyte_actual.txt test_ubyte_expected.txt +diff test_short_actual.txt test_short_expected.txt +diff test_ushort_actual.txt test_ushort_expected.txt +diff test_int_actual.txt test_int_expected.txt +diff test_uint_actual.txt test_uint_expected.txt +diff test_long_actual.txt test_long_expected.txt +diff test_ulong_actual.txt test_ulong_expected.txt +diff test_cent_actual.txt test_cent_expected.txt +diff test_ucent_actual.txt test_ucent_expected.txt +diff test_char_actual.txt test_char_expected.txt +diff test_wchar_actual.txt test_wchar_expected.txt +diff test_dchar_actual.txt test_dchar_expected.txt +diff test_float_actual.txt test_float_expected.txt +diff test_double_actual.txt test_double_expected.txt +diff test_real_actual.txt test_real_expected.txt +diff test_ifloat_actual.txt test_ifloat_expected.txt +diff test_idouble_actual.txt test_idouble_expected.txt +diff test_ireal_actual.txt test_ireal_expected.txt +diff test_cfloat_actual.txt test_cfloat_expected.txt +diff test_cdouble_actual.txt test_cdouble_expected.txt +diff test_creal_actual.txt test_creal_expected.txt +diff test_void_actual.txt test_void_expected.txt \ No newline at end of file diff --git a/tests/tc_ufcs_fundamental_types_completion/test_bool_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_bool_expected.txt new file mode 100644 index 0000000..fa7e821 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_bool_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someBool F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_byte_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_byte_expected.txt new file mode 100644 index 0000000..81f3a2a --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_byte_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someByte F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_cdouble_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_cdouble_expected.txt new file mode 100644 index 0000000..1c60888 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_cdouble_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someCdouble F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_cent_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_cent_expected.txt new file mode 100644 index 0000000..b4fca04 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_cent_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someCent F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_cfloat_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_cfloat_expected.txt new file mode 100644 index 0000000..0c3e3b7 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_cfloat_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someCfloat F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_char_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_char_expected.txt new file mode 100644 index 0000000..6034f3b --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_char_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someChar F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_creal_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_creal_expected.txt new file mode 100644 index 0000000..8d57466 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_creal_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someCreal F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_dchar_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_dchar_expected.txt new file mode 100644 index 0000000..86a7d83 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_dchar_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someDchar F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_double_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_double_expected.txt new file mode 100644 index 0000000..6a84525 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_double_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someDouble F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_float_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_float_expected.txt new file mode 100644 index 0000000..30d936a --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_float_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someFloat F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_idouble_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_idouble_expected.txt new file mode 100644 index 0000000..597ecda --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_idouble_expected.txt @@ -0,0 +1,20 @@ +identifiers +alignof k +dig k +epsilon k +im k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +re k +sizeof k +someIdouble F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_ifloat_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_ifloat_expected.txt new file mode 100644 index 0000000..78e46ba --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_ifloat_expected.txt @@ -0,0 +1,20 @@ +identifiers +alignof k +dig k +epsilon k +im k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +re k +sizeof k +someIfloat F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_int_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_int_expected.txt new file mode 100644 index 0000000..12183f9 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_int_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someInt F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_ireal_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_ireal_expected.txt new file mode 100644 index 0000000..2fafbe1 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_ireal_expected.txt @@ -0,0 +1,20 @@ +identifiers +alignof k +dig k +epsilon k +im k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +re k +sizeof k +someIreal F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_long_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_long_expected.txt new file mode 100644 index 0000000..90c08ce --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_long_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someLong F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_real_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_real_expected.txt new file mode 100644 index 0000000..21c83c4 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_real_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someReal F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_short_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_short_expected.txt new file mode 100644 index 0000000..1c50fc9 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_short_expected.txt @@ -0,0 +1,2 @@ +identifiers +x v diff --git a/tests/tc_ufcs_fundamental_types_completion/test_ubyte_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_ubyte_expected.txt new file mode 100644 index 0000000..864aa0d --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_ubyte_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someUbyte F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_ucent_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_ucent_expected.txt new file mode 100644 index 0000000..3815016 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_ucent_expected.txt @@ -0,0 +1,18 @@ +identifiers +alignof k +dig k +epsilon k +infinity k +init k +mangleof k +mant_dig k +max k +max_10_exp k +max_exp k +min_10_exp k +min_exp k +min_normal k +nan k +sizeof k +someUcent F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_uint_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_uint_expected.txt new file mode 100644 index 0000000..b34ebf8 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_uint_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someUint F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_ulong_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_ulong_expected.txt new file mode 100644 index 0000000..4d69bc6 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_ulong_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someUlong F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_ushort_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_ushort_expected.txt new file mode 100644 index 0000000..ecf0f61 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_ushort_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someUshort F +stringof k diff --git a/tests/tc_ufcs_fundamental_types_completion/test_void_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_void_expected.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/tc_ufcs_fundamental_types_completion/test_wchar_expected.txt b/tests/tc_ufcs_fundamental_types_completion/test_wchar_expected.txt new file mode 100644 index 0000000..29fd994 --- /dev/null +++ b/tests/tc_ufcs_fundamental_types_completion/test_wchar_expected.txt @@ -0,0 +1,9 @@ +identifiers +alignof k +init k +mangleof k +max k +min k +sizeof k +someWchar F +stringof k diff --git a/tests/tc_ufcs_completions/expected.txt b/tests/tc_ufcs_struct_completion/expected.txt similarity index 100% rename from tests/tc_ufcs_completions/expected.txt rename to tests/tc_ufcs_struct_completion/expected.txt diff --git a/tests/tc_ufcs_completions/file.d b/tests/tc_ufcs_struct_completion/file.d similarity index 100% rename from tests/tc_ufcs_completions/file.d rename to tests/tc_ufcs_struct_completion/file.d diff --git a/tests/tc_ufcs_completions/fooutils/fooutils.d b/tests/tc_ufcs_struct_completion/fooutils/fooutils.d similarity index 84% rename from tests/tc_ufcs_completions/fooutils/fooutils.d rename to tests/tc_ufcs_struct_completion/fooutils/fooutils.d index 4b06cfc..6f8b662 100644 --- a/tests/tc_ufcs_completions/fooutils/fooutils.d +++ b/tests/tc_ufcs_struct_completion/fooutils/fooutils.d @@ -13,5 +13,4 @@ void ufcsBarRefConstWrapped(ref const(Foo) foo, string mama) {} void ufcsBarRefImmuttableWrapped(ref immutable(Foo) foo, string mama) {} void ufcsBarScope(ref scope Foo foo, string mama) {} void ufcsBarReturnScope(return scope Foo foo, string mama) {} -private void ufcsBarPrivate(Foo foo, string message) {} -void helloBar(string message) {} \ No newline at end of file +private void ufcsBarPrivate(Foo foo, string message) {} \ No newline at end of file diff --git a/tests/tc_ufcs_completions/run.sh b/tests/tc_ufcs_struct_completion/run.sh similarity index 63% rename from tests/tc_ufcs_completions/run.sh rename to tests/tc_ufcs_struct_completion/run.sh index 35a4a43..5c8a62a 100755 --- a/tests/tc_ufcs_completions/run.sh +++ b/tests/tc_ufcs_struct_completion/run.sh @@ -2,4 +2,4 @@ set -e set -u ../../bin/dcd-client $1 -c100 -I"$PWD"/fooutils file.d > actual.txt -diff actual.txt expected.txt --strip-trailing-cr +diff actual.txt expected.txt \ No newline at end of file