From 0f615864383a00764fd8d31b74a087dbd836fd21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 16 Apr 2021 13:57:59 +0200 Subject: [PATCH] Add tests for "knr" brace style. --- tests/knr/.d.ref | 0 tests/knr/2d_arrays.d.ref | 37 +++++++++++++ tests/knr/DeclSpacing.d.ref | 15 +++++ tests/knr/array_access.d.ref | 6 ++ tests/knr/assoc_key_indent.d.ref | 8 +++ tests/knr/associative_array.d.ref | 25 +++++++++ tests/knr/associative_array_complex.d.ref | 25 +++++++++ tests/knr/attribute_constraint.d.ref | 13 +++++ tests/knr/breakOnDots.d.ref | 13 +++++ tests/knr/catchExceptionNested.d.ref | 41 ++++++++++++++ tests/knr/comments.d.ref | 7 +++ tests/knr/constraint_singe_tab.d.ref | 9 +++ tests/knr/constraint_singe_tab2.d.ref | 10 ++++ tests/knr/contracts.d.ref | 17 ++++++ tests/knr/debug-inside-if.d.ref | 7 +++ tests/knr/debug_with_param.d.ref | 7 +++ tests/knr/dip1009.d.ref | 18 ++++++ tests/knr/do_body.d.ref | 15 +++++ tests/knr/empty.d.ref | 0 tests/knr/enum_attribs.d.ref | 5 ++ tests/knr/frontpage.d.ref | 13 +++++ tests/knr/func_param_attrib.d.ref | 1 + tests/knr/guessnumber.d.ref | 30 ++++++++++ tests/knr/hello.d.ref | 6 ++ tests/knr/higherorder.d.ref | 12 ++++ tests/knr/issue0017.d.ref | 4 ++ tests/knr/issue0018.d.ref | 5 ++ tests/knr/issue0021.d.ref | 9 +++ tests/knr/issue0022.d.ref | 5 ++ tests/knr/issue0023.d.d.ref | 0 tests/knr/issue0023.d.ref | 36 ++++++++++++ tests/knr/issue0024.d.ref | 4 ++ tests/knr/issue0025.d.ref | 4 ++ tests/knr/issue0026.d.ref | 1 + tests/knr/issue0027.d.ref | 46 ++++++++++++++++ tests/knr/issue0028.d.ref | 16 ++++++ tests/knr/issue0029.d.ref | 3 + tests/knr/issue0030.d.ref | 3 + tests/knr/issue0031.d.ref | 6 ++ tests/knr/issue0032.d.ref | 7 +++ tests/knr/issue0033.d.ref | 14 +++++ tests/knr/issue0034.d.ref | 10 ++++ tests/knr/issue0035.d.ref | 5 ++ tests/knr/issue0037.d.ref | 15 +++++ tests/knr/issue0038.d.ref | 5 ++ tests/knr/issue0039.d.ref | 1 + tests/knr/issue0041.d.ref | 2 + tests/knr/issue0042.d.ref | 12 ++++ tests/knr/issue0043.d.ref | 13 +++++ tests/knr/issue0044.d.ref | 5 ++ tests/knr/issue0045.d.ref | 7 +++ tests/knr/issue0046.d.ref | 13 +++++ tests/knr/issue0047.d.ref | 29 ++++++++++ tests/knr/issue0048.d.ref | 5 ++ tests/knr/issue0049.d.ref | 11 ++++ tests/knr/issue0050.d.ref | 19 +++++++ tests/knr/issue0051.d.ref | 12 ++++ tests/knr/issue0052.d.ref | 8 +++ tests/knr/issue0053.d.ref | 11 ++++ tests/knr/issue0054.d.ref | 26 +++++++++ tests/knr/issue0056.d.ref | 16 ++++++ tests/knr/issue0057.d.ref | 14 +++++ tests/knr/issue0058.d.ref | 9 +++ tests/knr/issue0059.d.ref | 13 +++++ tests/knr/issue0060.d.ref | 4 ++ tests/knr/issue0061.d.ref | 1 + tests/knr/issue0062.d.ref | 5 ++ tests/knr/issue0063.d.ref | 4 ++ tests/knr/issue0064.d.ref | 17 ++++++ tests/knr/issue0065.d.ref | 7 +++ tests/knr/issue0066.d.ref | 8 +++ tests/knr/issue0067.d.ref | 1 + tests/knr/issue0068.d.ref | 3 + tests/knr/issue0069.d.ref | 7 +++ tests/knr/issue0070.d.ref | 7 +++ tests/knr/issue0073.d.ref | 7 +++ tests/knr/issue0074.d.ref | 13 +++++ tests/knr/issue0076.d.ref | 5 ++ tests/knr/issue0079.d.ref | 8 +++ tests/knr/issue0080.d.ref | 10 ++++ tests/knr/issue0081.d.ref | 15 +++++ tests/knr/issue0082.d.ref | 10 ++++ tests/knr/issue0083.d.ref | 5 ++ tests/knr/issue0085.d.ref | 1 + tests/knr/issue0086.d.ref | 22 ++++++++ tests/knr/issue0088.d.ref | 7 +++ tests/knr/issue0089.d.ref | 5 ++ tests/knr/issue0090.d.ref | 8 +++ tests/knr/issue0091.d.ref | 10 ++++ tests/knr/issue0092.d.ref | 15 +++++ tests/knr/issue0093.d.ref | 7 +++ tests/knr/issue0094.d.ref | 6 ++ tests/knr/issue0095.d.ref | 6 ++ tests/knr/issue0096.d.ref | 13 +++++ tests/knr/issue0097.d.ref | 33 +++++++++++ tests/knr/issue0098.d.ref | 6 ++ tests/knr/issue0099.d.ref | 31 +++++++++++ tests/knr/issue0100.d.ref | 12 ++++ tests/knr/issue0101.d.ref | 9 +++ tests/knr/issue0102.d.ref | 1 + tests/knr/issue0106.d.ref | 2 + tests/knr/issue0107.d.ref | 14 +++++ tests/knr/issue0108.d.ref | 10 ++++ tests/knr/issue0109.d.ref | 5 ++ tests/knr/issue0111.d.ref | 7 +++ tests/knr/issue0112.d.ref | 13 +++++ tests/knr/issue0112_variation.d.ref | 13 +++++ tests/knr/issue0114.d.ref | 4 ++ tests/knr/issue0116.d.ref | 7 +++ tests/knr/issue0117.d.ref | 6 ++ tests/knr/issue0118.d.ref | 14 +++++ tests/knr/issue0119.d.ref | 24 ++++++++ tests/knr/issue0120.d.ref | 3 + tests/knr/issue0123.d.ref | 6 ++ tests/knr/issue0125.d.ref | 11 ++++ tests/knr/issue0126.d.ref | 6 ++ tests/knr/issue0127.d.ref | 4 ++ tests/knr/issue0128.d.ref | 4 ++ tests/knr/issue0130.d.ref | 10 ++++ tests/knr/issue0134.d.ref | 14 +++++ tests/knr/issue0136.d.ref | 3 + tests/knr/issue0138.d.ref | 7 +++ tests/knr/issue0139.d.ref | 24 ++++++++ tests/knr/issue0140.d.ref | 5 ++ tests/knr/issue0142.d.ref | 3 + tests/knr/issue0146.d.ref | 1 + tests/knr/issue0147.d.ref | 1 + tests/knr/issue0148.d.ref | 6 ++ tests/knr/issue0150.d.ref | 5 ++ tests/knr/issue0151.d.ref | 7 +++ tests/knr/issue0152.d.ref | 1 + tests/knr/issue0153.d.ref | 6 ++ tests/knr/issue0154.d.ref | 5 ++ tests/knr/issue0155.d.ref | 3 + tests/knr/issue0156.d.ref | 7 +++ tests/knr/issue0158.d.ref | 6 ++ tests/knr/issue0162.d.ref | 8 +++ tests/knr/issue0166.d.ref | 9 +++ tests/knr/issue0169.d.ref | 10 ++++ tests/knr/issue0172.d.ref | 6 ++ tests/knr/issue0174.d.ref | 5 ++ tests/knr/issue0177.d.ref | 26 +++++++++ tests/knr/issue0185.d.ref | 12 ++++ tests/knr/issue0186.d.ref | 23 ++++++++ tests/knr/issue0187.d.ref | 3 + tests/knr/issue0189.d.ref | 17 ++++++ tests/knr/issue0190.d.ref | 6 ++ tests/knr/issue0194.d.ref | 10 ++++ tests/knr/issue0195.d.ref | 15 +++++ tests/knr/issue0204.d.ref | 10 ++++ tests/knr/issue0205.d.ref | 6 ++ tests/knr/issue0206.d.ref | 7 +++ tests/knr/issue0207.d.ref | 10 ++++ tests/knr/issue0208.d.ref | 5 ++ tests/knr/issue0209.d.ref | 18 ++++++ tests/knr/issue0210.d.ref | 2 + tests/knr/issue0212.d.ref | 3 + tests/knr/issue0213.d.ref | 6 ++ tests/knr/issue0215a.d.ref | 17 ++++++ tests/knr/issue0215b.d.ref | 17 ++++++ tests/knr/issue0215c.d.ref | 18 ++++++ tests/knr/issue0215d.d.ref | 18 ++++++ tests/knr/issue0216.d.ref | 5 ++ tests/knr/issue0219.d.ref | 5 ++ tests/knr/issue0220.d.ref | 67 +++++++++++++++++++++++ tests/knr/issue0221.d.ref | 4 ++ tests/knr/issue0222.d.ref | 4 ++ tests/knr/issue0223.d.ref | 6 ++ tests/knr/issue0224.d.ref | 5 ++ tests/knr/issue0225.d.ref | 4 ++ tests/knr/issue0226.d.ref | 14 +++++ tests/knr/issue0229.d.ref | 23 ++++++++ tests/knr/issue0237.d.ref | 39 +++++++++++++ tests/knr/issue0241.d.ref | 3 + tests/knr/issue0244.d.ref | 4 ++ tests/knr/issue0246.d.ref | 17 ++++++ tests/knr/issue0248.d.ref | 11 ++++ tests/knr/issue0251.d.ref | 8 +++ tests/knr/issue0256.d.ref | 11 ++++ tests/knr/issue0267.d.ref | 19 +++++++ tests/knr/issue0273.d.ref | 4 ++ tests/knr/issue0286.d.ref | 14 +++++ tests/knr/issue0287.d.ref | 3 + tests/knr/issue0303.d.ref | 10 ++++ tests/knr/issue0313.d.ref | 13 +++++ tests/knr/issue0314.d.ref | 10 ++++ tests/knr/issue0321.d.ref | 7 +++ tests/knr/issue0326.d.ref | 4 ++ tests/knr/issue0345.d.ref | 3 + tests/knr/issue0349.d.ref | 6 ++ tests/knr/issue0361.d.ref | 11 ++++ tests/knr/issue0372.d.ref | 22 ++++++++ tests/knr/issue0384.d.ref | 30 ++++++++++ tests/knr/issue0426.d.ref | 6 ++ tests/knr/issue0430.d.ref | 5 ++ tests/knr/issue0433.d.ref | 7 +++ tests/knr/issue0436.d.ref | 1 + tests/knr/issue0448.d.ref | 3 + tests/knr/issue0452.d.ref | 2 + tests/knr/issue0454.d.ref | 10 ++++ tests/knr/issue0465.d.ref | 8 +++ tests/knr/issue0476.d.ref | 7 +++ tests/knr/issue0483.d.ref | 14 +++++ tests/knr/issue0485.d.ref | 5 ++ tests/knr/issue0486.d.ref | 5 ++ tests/knr/issue0497.d.ref | 5 ++ tests/knr/issue0501.d.ref | 4 ++ tests/knr/issue0504.d.ref | 40 ++++++++++++++ tests/knr/issue0508.d.ref | 5 ++ tests/knr/issue0509.d.ref | 34 ++++++++++++ tests/knr/issue0515.d.ref | 6 ++ tests/knr/issue0521.d.ref | 16 ++++++ tests/knr/keep_line_breaks.d.ref | 35 ++++++++++++ tests/knr/lambda_param_attrib.d.ref | 1 + tests/knr/longParamList.d.ref | 17 ++++++ tests/knr/minimizeLength.d.ref | 19 +++++++ tests/knr/multiline_string.d.ref | 11 ++++ tests/knr/parenIndent.d.ref | 31 +++++++++++ tests/knr/propertySpacing.d.ref | 1 + tests/knr/swap.d.ref | 26 +++++++++ tests/knr/ufcschain.d.ref | 6 ++ tests/knr/wrapping1.d.ref | 7 +++ tests/test.sh | 2 +- 223 files changed, 2371 insertions(+), 1 deletion(-) create mode 100644 tests/knr/.d.ref create mode 100644 tests/knr/2d_arrays.d.ref create mode 100644 tests/knr/DeclSpacing.d.ref create mode 100644 tests/knr/array_access.d.ref create mode 100644 tests/knr/assoc_key_indent.d.ref create mode 100644 tests/knr/associative_array.d.ref create mode 100644 tests/knr/associative_array_complex.d.ref create mode 100644 tests/knr/attribute_constraint.d.ref create mode 100644 tests/knr/breakOnDots.d.ref create mode 100644 tests/knr/catchExceptionNested.d.ref create mode 100644 tests/knr/comments.d.ref create mode 100644 tests/knr/constraint_singe_tab.d.ref create mode 100644 tests/knr/constraint_singe_tab2.d.ref create mode 100644 tests/knr/contracts.d.ref create mode 100644 tests/knr/debug-inside-if.d.ref create mode 100644 tests/knr/debug_with_param.d.ref create mode 100644 tests/knr/dip1009.d.ref create mode 100644 tests/knr/do_body.d.ref create mode 100644 tests/knr/empty.d.ref create mode 100644 tests/knr/enum_attribs.d.ref create mode 100644 tests/knr/frontpage.d.ref create mode 100644 tests/knr/func_param_attrib.d.ref create mode 100644 tests/knr/guessnumber.d.ref create mode 100644 tests/knr/hello.d.ref create mode 100644 tests/knr/higherorder.d.ref create mode 100644 tests/knr/issue0017.d.ref create mode 100644 tests/knr/issue0018.d.ref create mode 100644 tests/knr/issue0021.d.ref create mode 100644 tests/knr/issue0022.d.ref create mode 100644 tests/knr/issue0023.d.d.ref create mode 100644 tests/knr/issue0023.d.ref create mode 100644 tests/knr/issue0024.d.ref create mode 100644 tests/knr/issue0025.d.ref create mode 100644 tests/knr/issue0026.d.ref create mode 100644 tests/knr/issue0027.d.ref create mode 100644 tests/knr/issue0028.d.ref create mode 100644 tests/knr/issue0029.d.ref create mode 100644 tests/knr/issue0030.d.ref create mode 100644 tests/knr/issue0031.d.ref create mode 100644 tests/knr/issue0032.d.ref create mode 100644 tests/knr/issue0033.d.ref create mode 100644 tests/knr/issue0034.d.ref create mode 100644 tests/knr/issue0035.d.ref create mode 100644 tests/knr/issue0037.d.ref create mode 100644 tests/knr/issue0038.d.ref create mode 100644 tests/knr/issue0039.d.ref create mode 100644 tests/knr/issue0041.d.ref create mode 100644 tests/knr/issue0042.d.ref create mode 100644 tests/knr/issue0043.d.ref create mode 100644 tests/knr/issue0044.d.ref create mode 100644 tests/knr/issue0045.d.ref create mode 100644 tests/knr/issue0046.d.ref create mode 100644 tests/knr/issue0047.d.ref create mode 100644 tests/knr/issue0048.d.ref create mode 100644 tests/knr/issue0049.d.ref create mode 100644 tests/knr/issue0050.d.ref create mode 100644 tests/knr/issue0051.d.ref create mode 100644 tests/knr/issue0052.d.ref create mode 100644 tests/knr/issue0053.d.ref create mode 100644 tests/knr/issue0054.d.ref create mode 100644 tests/knr/issue0056.d.ref create mode 100644 tests/knr/issue0057.d.ref create mode 100644 tests/knr/issue0058.d.ref create mode 100644 tests/knr/issue0059.d.ref create mode 100644 tests/knr/issue0060.d.ref create mode 100644 tests/knr/issue0061.d.ref create mode 100644 tests/knr/issue0062.d.ref create mode 100644 tests/knr/issue0063.d.ref create mode 100644 tests/knr/issue0064.d.ref create mode 100644 tests/knr/issue0065.d.ref create mode 100644 tests/knr/issue0066.d.ref create mode 100644 tests/knr/issue0067.d.ref create mode 100644 tests/knr/issue0068.d.ref create mode 100644 tests/knr/issue0069.d.ref create mode 100644 tests/knr/issue0070.d.ref create mode 100644 tests/knr/issue0073.d.ref create mode 100644 tests/knr/issue0074.d.ref create mode 100644 tests/knr/issue0076.d.ref create mode 100644 tests/knr/issue0079.d.ref create mode 100644 tests/knr/issue0080.d.ref create mode 100644 tests/knr/issue0081.d.ref create mode 100644 tests/knr/issue0082.d.ref create mode 100644 tests/knr/issue0083.d.ref create mode 100644 tests/knr/issue0085.d.ref create mode 100644 tests/knr/issue0086.d.ref create mode 100644 tests/knr/issue0088.d.ref create mode 100644 tests/knr/issue0089.d.ref create mode 100644 tests/knr/issue0090.d.ref create mode 100644 tests/knr/issue0091.d.ref create mode 100644 tests/knr/issue0092.d.ref create mode 100644 tests/knr/issue0093.d.ref create mode 100644 tests/knr/issue0094.d.ref create mode 100644 tests/knr/issue0095.d.ref create mode 100644 tests/knr/issue0096.d.ref create mode 100644 tests/knr/issue0097.d.ref create mode 100644 tests/knr/issue0098.d.ref create mode 100644 tests/knr/issue0099.d.ref create mode 100644 tests/knr/issue0100.d.ref create mode 100644 tests/knr/issue0101.d.ref create mode 100644 tests/knr/issue0102.d.ref create mode 100644 tests/knr/issue0106.d.ref create mode 100644 tests/knr/issue0107.d.ref create mode 100644 tests/knr/issue0108.d.ref create mode 100644 tests/knr/issue0109.d.ref create mode 100644 tests/knr/issue0111.d.ref create mode 100644 tests/knr/issue0112.d.ref create mode 100644 tests/knr/issue0112_variation.d.ref create mode 100644 tests/knr/issue0114.d.ref create mode 100644 tests/knr/issue0116.d.ref create mode 100644 tests/knr/issue0117.d.ref create mode 100644 tests/knr/issue0118.d.ref create mode 100644 tests/knr/issue0119.d.ref create mode 100644 tests/knr/issue0120.d.ref create mode 100644 tests/knr/issue0123.d.ref create mode 100644 tests/knr/issue0125.d.ref create mode 100644 tests/knr/issue0126.d.ref create mode 100644 tests/knr/issue0127.d.ref create mode 100644 tests/knr/issue0128.d.ref create mode 100644 tests/knr/issue0130.d.ref create mode 100644 tests/knr/issue0134.d.ref create mode 100644 tests/knr/issue0136.d.ref create mode 100644 tests/knr/issue0138.d.ref create mode 100644 tests/knr/issue0139.d.ref create mode 100644 tests/knr/issue0140.d.ref create mode 100644 tests/knr/issue0142.d.ref create mode 100644 tests/knr/issue0146.d.ref create mode 100644 tests/knr/issue0147.d.ref create mode 100644 tests/knr/issue0148.d.ref create mode 100644 tests/knr/issue0150.d.ref create mode 100644 tests/knr/issue0151.d.ref create mode 100644 tests/knr/issue0152.d.ref create mode 100644 tests/knr/issue0153.d.ref create mode 100644 tests/knr/issue0154.d.ref create mode 100644 tests/knr/issue0155.d.ref create mode 100644 tests/knr/issue0156.d.ref create mode 100644 tests/knr/issue0158.d.ref create mode 100644 tests/knr/issue0162.d.ref create mode 100644 tests/knr/issue0166.d.ref create mode 100644 tests/knr/issue0169.d.ref create mode 100644 tests/knr/issue0172.d.ref create mode 100644 tests/knr/issue0174.d.ref create mode 100644 tests/knr/issue0177.d.ref create mode 100644 tests/knr/issue0185.d.ref create mode 100644 tests/knr/issue0186.d.ref create mode 100644 tests/knr/issue0187.d.ref create mode 100644 tests/knr/issue0189.d.ref create mode 100644 tests/knr/issue0190.d.ref create mode 100644 tests/knr/issue0194.d.ref create mode 100644 tests/knr/issue0195.d.ref create mode 100644 tests/knr/issue0204.d.ref create mode 100644 tests/knr/issue0205.d.ref create mode 100644 tests/knr/issue0206.d.ref create mode 100644 tests/knr/issue0207.d.ref create mode 100644 tests/knr/issue0208.d.ref create mode 100644 tests/knr/issue0209.d.ref create mode 100644 tests/knr/issue0210.d.ref create mode 100644 tests/knr/issue0212.d.ref create mode 100644 tests/knr/issue0213.d.ref create mode 100644 tests/knr/issue0215a.d.ref create mode 100644 tests/knr/issue0215b.d.ref create mode 100644 tests/knr/issue0215c.d.ref create mode 100644 tests/knr/issue0215d.d.ref create mode 100644 tests/knr/issue0216.d.ref create mode 100644 tests/knr/issue0219.d.ref create mode 100644 tests/knr/issue0220.d.ref create mode 100644 tests/knr/issue0221.d.ref create mode 100644 tests/knr/issue0222.d.ref create mode 100644 tests/knr/issue0223.d.ref create mode 100644 tests/knr/issue0224.d.ref create mode 100644 tests/knr/issue0225.d.ref create mode 100644 tests/knr/issue0226.d.ref create mode 100644 tests/knr/issue0229.d.ref create mode 100644 tests/knr/issue0237.d.ref create mode 100644 tests/knr/issue0241.d.ref create mode 100644 tests/knr/issue0244.d.ref create mode 100644 tests/knr/issue0246.d.ref create mode 100644 tests/knr/issue0248.d.ref create mode 100644 tests/knr/issue0251.d.ref create mode 100644 tests/knr/issue0256.d.ref create mode 100644 tests/knr/issue0267.d.ref create mode 100644 tests/knr/issue0273.d.ref create mode 100644 tests/knr/issue0286.d.ref create mode 100644 tests/knr/issue0287.d.ref create mode 100644 tests/knr/issue0303.d.ref create mode 100644 tests/knr/issue0313.d.ref create mode 100644 tests/knr/issue0314.d.ref create mode 100644 tests/knr/issue0321.d.ref create mode 100644 tests/knr/issue0326.d.ref create mode 100644 tests/knr/issue0345.d.ref create mode 100644 tests/knr/issue0349.d.ref create mode 100644 tests/knr/issue0361.d.ref create mode 100644 tests/knr/issue0372.d.ref create mode 100644 tests/knr/issue0384.d.ref create mode 100644 tests/knr/issue0426.d.ref create mode 100644 tests/knr/issue0430.d.ref create mode 100644 tests/knr/issue0433.d.ref create mode 100644 tests/knr/issue0436.d.ref create mode 100644 tests/knr/issue0448.d.ref create mode 100644 tests/knr/issue0452.d.ref create mode 100644 tests/knr/issue0454.d.ref create mode 100644 tests/knr/issue0465.d.ref create mode 100644 tests/knr/issue0476.d.ref create mode 100644 tests/knr/issue0483.d.ref create mode 100644 tests/knr/issue0485.d.ref create mode 100644 tests/knr/issue0486.d.ref create mode 100644 tests/knr/issue0497.d.ref create mode 100644 tests/knr/issue0501.d.ref create mode 100644 tests/knr/issue0504.d.ref create mode 100644 tests/knr/issue0508.d.ref create mode 100644 tests/knr/issue0509.d.ref create mode 100644 tests/knr/issue0515.d.ref create mode 100644 tests/knr/issue0521.d.ref create mode 100644 tests/knr/keep_line_breaks.d.ref create mode 100644 tests/knr/lambda_param_attrib.d.ref create mode 100644 tests/knr/longParamList.d.ref create mode 100644 tests/knr/minimizeLength.d.ref create mode 100644 tests/knr/multiline_string.d.ref create mode 100644 tests/knr/parenIndent.d.ref create mode 100644 tests/knr/propertySpacing.d.ref create mode 100644 tests/knr/swap.d.ref create mode 100644 tests/knr/ufcschain.d.ref create mode 100644 tests/knr/wrapping1.d.ref diff --git a/tests/knr/.d.ref b/tests/knr/.d.ref new file mode 100644 index 0000000..e69de29 diff --git a/tests/knr/2d_arrays.d.ref b/tests/knr/2d_arrays.d.ref new file mode 100644 index 0000000..5b685ec --- /dev/null +++ b/tests/knr/2d_arrays.d.ref @@ -0,0 +1,37 @@ +unittest { + targets = [ + [ + RectangleShape.create(tex, vec2(-8 * scale, -32 * scale), + vec2(16 * scale, 48 * scale), vec4(14 / 16.0, 0, 16 / 16.0, 3 / 16.0)), + RectangleShape.create(tex, vec2(-8 * scale, -32 * scale), + vec2(16 * scale, 32 * scale), vec4(14 / 16.0, 3 / 16.0, 16 / 16.0, 5 / 16.0)) + ], + [ + RectangleShape.create(tex, vec2(-8 * scale, -8 * scale), + vec2(16 * scale, 16 * scale), vec4(14 / 16.0, 5 / 16.0, 15 / 16.0, 6 / 16.0)), + RectangleShape.create(tex, vec2(-8 * scale, -8 * scale), + vec2(16 * scale, 16 * scale), vec4(15 / 16.0, 5 / 16.0, 16 / 16.0, 6 / 16.0)) + ] + ]; + + int[][] foo = [ + [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + ], + [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + ] + ]; + + float[3][3] mat = [ + [234.3456, 42435.8653, 23.5], [3.245, 235.3, 234.664], + [14324.6453, 23434.645, 9678.345] + ]; +} + +string[][] globalArray = [ + ["123456789012345678901234567890", "123456789012345678901234567890"], + ["123456789012345678901234567890", "123456789012345678901234567890"] +]; diff --git a/tests/knr/DeclSpacing.d.ref b/tests/knr/DeclSpacing.d.ref new file mode 100644 index 0000000..ce51064 --- /dev/null +++ b/tests/knr/DeclSpacing.d.ref @@ -0,0 +1,15 @@ +import std.stdio; + +class Foo { +} + +import std.conv; + +void main() +{ + return; +} + +const baz = 11; +class Foo2 : Foo { +} diff --git a/tests/knr/array_access.d.ref b/tests/knr/array_access.d.ref new file mode 100644 index 0000000..7a2ac55 --- /dev/null +++ b/tests/knr/array_access.d.ref @@ -0,0 +1,6 @@ +unittest { + foo([ + target.value.region[1], target.value.region[1], + target.value.region[1], target.value.region[1], target.value.region[1] + ]); +} diff --git a/tests/knr/assoc_key_indent.d.ref b/tests/knr/assoc_key_indent.d.ref new file mode 100644 index 0000000..a357a35 --- /dev/null +++ b/tests/knr/assoc_key_indent.d.ref @@ -0,0 +1,8 @@ +void main() +{ + string key; + + int[string] var = [ + key: 5 + ]; +} diff --git a/tests/knr/associative_array.d.ref b/tests/knr/associative_array.d.ref new file mode 100644 index 0000000..39f18c6 --- /dev/null +++ b/tests/knr/associative_array.d.ref @@ -0,0 +1,25 @@ +unittest { + Bson base = Bson([ + "maps": Bson([ + Bson(["id": Bson(4), "comment": Bson("hello")]), + Bson(["id": Bson(49), "comment": Bson(null)]) + ]), + "short": Bson(["a": "b", "c": "d"]), + "numbers": Bson([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 + ]), + "shuffleOnReset": serializeToBson([ + "all": false, + "selected": true, + "maybe": false + ]), + "resetOnEmpty": Bson(false), + "applyMods": Bson(true), + "sendComments": Bson(true) + ]); + int[] x = [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 + ]; +} diff --git a/tests/knr/associative_array_complex.d.ref b/tests/knr/associative_array_complex.d.ref new file mode 100644 index 0000000..c7b803b --- /dev/null +++ b/tests/knr/associative_array_complex.d.ref @@ -0,0 +1,25 @@ +auto find() +{ + return Map.findRange([ + "$and": [ + ["deleted": Bson(false)], + [ + "$or": Bson([ + serializeToBson(["forceUpdate": Bson(true)]), + serializeToBson([ + "info.approved": ["$eq": Bson(1)], + "fetchDate": [ + "$lte": Bson(BsonDate(currentTime - 60.days)) + ] + ]), + serializeToBson([ + "info.approved": ["$ne": Bson(1)], + "fetchDate": [ + "$lte": Bson(BsonDate(currentTime - 14.days)) + ] + ]) + ]) + ] + ] + ]); +} diff --git a/tests/knr/attribute_constraint.d.ref b/tests/knr/attribute_constraint.d.ref new file mode 100644 index 0000000..db4af0d --- /dev/null +++ b/tests/knr/attribute_constraint.d.ref @@ -0,0 +1,13 @@ +struct SomeStructName { + static struct InnerStruct { + version (linux) { + static if (condition) { + void longFunctionName(AAAAAAAA)(AAAAAAAA a) @property + if (someThingsAreTrue!AAAAAAAA && long_condition + && is(elaborate == expression)) + { + } + } + } + } +} diff --git a/tests/knr/breakOnDots.d.ref b/tests/knr/breakOnDots.d.ref new file mode 100644 index 0000000..bdfb29b --- /dev/null +++ b/tests/knr/breakOnDots.d.ref @@ -0,0 +1,13 @@ +unittest { + { + { + foreach (abcde, def; abcdef.map!(battlecruiser => battlecruiser[123 .. 1231231]) + .filter!(bravo => charlie[10] > 90000) + .sum()) { + + } + abcdeabcdeabcde(12341234).abcdeabcdeabcde(12341234).abcdeabcdeabcde(12341234) + .abcdeabcdeabcde(12341234).abcdeabcdeabcde(12341234); + } + } +} diff --git a/tests/knr/catchExceptionNested.d.ref b/tests/knr/catchExceptionNested.d.ref new file mode 100644 index 0000000..57217c1 --- /dev/null +++ b/tests/knr/catchExceptionNested.d.ref @@ -0,0 +1,41 @@ +class U0 : Exception { + this() @safe pure nothrow + { + super("U0 error message"); + } +} + +class U1 : Exception { + this() @safe pure nothrow + { + super("U1 error message"); + } +} + +void foo() +{ + import std.stdio; + + foreach (immutable i; 0 .. 2) { + try { + i.bar; + } catch (U0) { + "Function foo caught exception U0".writeln; + } + } +} + +void bar(in int i) @safe pure +{ + i.baz; +} + +void baz(in int i) @safe pure +{ + throw i ? new U1 : new U0; +} + +void main() +{ + foo; +} diff --git a/tests/knr/comments.d.ref b/tests/knr/comments.d.ref new file mode 100644 index 0000000..7139949 --- /dev/null +++ b/tests/knr/comments.d.ref @@ -0,0 +1,7 @@ +int /*sneaky*/ foo( /*comments*/ ) /*everywhere*/ +{ + // comment on its own line + foo() // comment on same line + .bar(); // also on same line + /* again */ // same line +} diff --git a/tests/knr/constraint_singe_tab.d.ref b/tests/knr/constraint_singe_tab.d.ref new file mode 100644 index 0000000..176e0f4 --- /dev/null +++ b/tests/knr/constraint_singe_tab.d.ref @@ -0,0 +1,9 @@ +void foo()() + if (dogs && pigs && birds && ants && foxes && flies && cats && bugs && bees + && cows && sheeps && monkeys && whales) +{ +} + +void foo()() if (dogs && pigs && birds) +{ +} diff --git a/tests/knr/constraint_singe_tab2.d.ref b/tests/knr/constraint_singe_tab2.d.ref new file mode 100644 index 0000000..59c0cb1 --- /dev/null +++ b/tests/knr/constraint_singe_tab2.d.ref @@ -0,0 +1,10 @@ +void foo()() + if (dogs && pigs && birds && ants && foxes && flies && cats && bugs && bees + && cows && sheeps && monkeys && whales) +{ +} + +void foo()() + if (dogs && pigs && birds) +{ +} diff --git a/tests/knr/contracts.d.ref b/tests/knr/contracts.d.ref new file mode 100644 index 0000000..c90e330 --- /dev/null +++ b/tests/knr/contracts.d.ref @@ -0,0 +1,17 @@ +void main(string[] args) +{ + struct SomeStruct { + private: + int a; + int b; + void doStuff(int q) + in { + assert(q); + } + out (result) { + } + body { + writeln(q); + } + } +} diff --git a/tests/knr/debug-inside-if.d.ref b/tests/knr/debug-inside-if.d.ref new file mode 100644 index 0000000..13252df --- /dev/null +++ b/tests/knr/debug-inside-if.d.ref @@ -0,0 +1,7 @@ +void main() +{ + if (true) + debug { + foo(); + } +} diff --git a/tests/knr/debug_with_param.d.ref b/tests/knr/debug_with_param.d.ref new file mode 100644 index 0000000..b2c9baa --- /dev/null +++ b/tests/knr/debug_with_param.d.ref @@ -0,0 +1,7 @@ +void main() +{ + debug (0) + foo(); + else + bar(); +} diff --git a/tests/knr/dip1009.d.ref b/tests/knr/dip1009.d.ref new file mode 100644 index 0000000..ba2417d --- /dev/null +++ b/tests/knr/dip1009.d.ref @@ -0,0 +1,18 @@ +int foo(int arg) +in { + assert(arg > 0); +} +out (result) { + assert(result == 0); +} +do { + return 0; +} + +int bar(int arg) +in (arg > 0) +out (; true) +out /*Major*/ ( /*Tom*/ result /*To ground control*/ ; result == 0) +{ + return 0; +} diff --git a/tests/knr/do_body.d.ref b/tests/knr/do_body.d.ref new file mode 100644 index 0000000..89138ce --- /dev/null +++ b/tests/knr/do_body.d.ref @@ -0,0 +1,15 @@ +import character.body; + +void body() @nogc +in { +} +body { + body = null; +} + +void body() +in { +} +do { + body = null; +} diff --git a/tests/knr/empty.d.ref b/tests/knr/empty.d.ref new file mode 100644 index 0000000..e69de29 diff --git a/tests/knr/enum_attribs.d.ref b/tests/knr/enum_attribs.d.ref new file mode 100644 index 0000000..8ff4288 --- /dev/null +++ b/tests/knr/enum_attribs.d.ref @@ -0,0 +1,5 @@ +enum Foo { + + deprecated member0, + @UDA(0) member1 +} diff --git a/tests/knr/frontpage.d.ref b/tests/knr/frontpage.d.ref new file mode 100644 index 0000000..f7d9a45 --- /dev/null +++ b/tests/knr/frontpage.d.ref @@ -0,0 +1,13 @@ +// Computes average line length for standard input. +import std.stdio; + +void main() +{ + ulong lines = 0; + double sumLength = 0; + foreach (line; stdin.byLine()) { + ++lines; + sumLength += line.length; + } + writeln("Average line length: ", lines ? sumLength / lines : 0); +} diff --git a/tests/knr/func_param_attrib.d.ref b/tests/knr/func_param_attrib.d.ref new file mode 100644 index 0000000..8717517 --- /dev/null +++ b/tests/knr/func_param_attrib.d.ref @@ -0,0 +1 @@ +void foo(@UDA(0) @UDA(1) Bar bar); diff --git a/tests/knr/guessnumber.d.ref b/tests/knr/guessnumber.d.ref new file mode 100644 index 0000000..8ee4a28 --- /dev/null +++ b/tests/knr/guessnumber.d.ref @@ -0,0 +1,30 @@ +import std.stdio, std.random, std.typecons, std.conv, std.string, std.range; + +void main() +{ + immutable interval = tuple(1, 100); + writefln("Guess my target number that is between " ~ "%d and %d (inclusive).\n", interval[]); + immutable target = uniform!"[]"(interval[]); + + foreach (immutable i; sequence!q{n}) { + writef("Your guess #%d: ", i + 1); + immutable txt = stdin.readln.strip; + + Nullable!int answer; + try { + answer = txt.to!int; + } catch (ConvException e) { + writefln(" I don't understand your input '%s'", txt); + continue; + } + if (answer < interval[0] || answer > interval[1]) { + writeln(" Out of range!"); + continue; + } + if (answer == target) { + writeln(" Well guessed."); + break; + } + writeln(answer < target ? " Too low." : " Too high."); + } +} diff --git a/tests/knr/hello.d.ref b/tests/knr/hello.d.ref new file mode 100644 index 0000000..0beb9aa --- /dev/null +++ b/tests/knr/hello.d.ref @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Hello, world without explicit compilations!"); +} diff --git a/tests/knr/higherorder.d.ref b/tests/knr/higherorder.d.ref new file mode 100644 index 0000000..be9b953 --- /dev/null +++ b/tests/knr/higherorder.d.ref @@ -0,0 +1,12 @@ +int hof(int a, int b, int delegate(int, int) f) +{ + return f(a, b); +} + +void main() +{ + import std.stdio; + + writeln("Add: ", hof(2, 3, (a, b) => a + b)); + writeln("Multiply: ", hof(2, 3, (a, b) => a * b)); +} diff --git a/tests/knr/issue0017.d.ref b/tests/knr/issue0017.d.ref new file mode 100644 index 0000000..541c22a --- /dev/null +++ b/tests/knr/issue0017.d.ref @@ -0,0 +1,4 @@ +immutable NameId[] namesA = [ + {"Aacgr", 0x00386}, // GREEK CAPITAL LETTER ALPHA WITH TONOS + {"aacgr", 0x003AC}, // GREEK SMALL LETTER ALPHA WITH TONOS +]; diff --git a/tests/knr/issue0018.d.ref b/tests/knr/issue0018.d.ref new file mode 100644 index 0000000..2e7d77c --- /dev/null +++ b/tests/knr/issue0018.d.ref @@ -0,0 +1,5 @@ +import core.stdc.ctype; + +/********************************************* + * + */ diff --git a/tests/knr/issue0021.d.ref b/tests/knr/issue0021.d.ref new file mode 100644 index 0000000..ed28391 --- /dev/null +++ b/tests/knr/issue0021.d.ref @@ -0,0 +1,9 @@ +void func() +{ + if (!negative) + return this; + else if (a.negative) + return max(); + else + return a.value == 0 ? a : this; +} diff --git a/tests/knr/issue0022.d.ref b/tests/knr/issue0022.d.ref new file mode 100644 index 0000000..81c0d3b --- /dev/null +++ b/tests/knr/issue0022.d.ref @@ -0,0 +1,5 @@ +struct X { + ~this() + { + } +} diff --git a/tests/knr/issue0023.d.d.ref b/tests/knr/issue0023.d.d.ref new file mode 100644 index 0000000..e69de29 diff --git a/tests/knr/issue0023.d.ref b/tests/knr/issue0023.d.ref new file mode 100644 index 0000000..64e52e3 --- /dev/null +++ b/tests/knr/issue0023.d.ref @@ -0,0 +1,36 @@ +string generateFixedLengthCases() +{ + int[] shortList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + something[] items = [ + one, two, three, four, five, six, seven, eight, nine, ten, eleven, + twelve, thirteen, fourteen + ]; + + string[] fixedLengthTokens = [ + "abstract", "alias", "align", "asm", "assert", "auto", "body", "bool", + "break", "byte", "case", "cast", "catch", "cdouble", "cent", "cfloat", + "char", "class", "const", "continue", "creal", "dchar", "debug", "default", + "delegate", "delete", "deprecated", "do", "double", "else", "enum", + "export", "extern", "false", "final", "finally", "float", "for", "foreach", + "foreach_reverse", "function", "goto", "idouble", "if", "ifloat", + "immutable", "import", "in", "inout", "int", "interface", "invariant", + "ireal", "is", "lazy", "long", "macro", "mixin", "module", "new", + "nothrow", "null", "out", "override", "package", "pragma", "private", + "protected", "public", "pure", "real", "ref", "return", "scope", "shared", + "short", "static", "struct", "super", "switch", "synchronized", "template", + "this", "throw", "true", "try", "typedef", "typeid", "typeof", "ubyte", + "ucent", "uint", "ulong", "union", "unittest", "ushort", "version", "void", + "volatile", "wchar", "while", "with", "__DATE__", "__EOF__", + "__FILE__", "__FUNCTION__", "__gshared", "__LINE__", + "__MODULE__", "__parameters", "__PRETTY_FUNCTION__", "__TIME__", + "__TIMESTAMP__", "__traits", "__vector", "__VENDOR__", "__VERSION__", + ",", ".", "..", "...", "/", "/=", "!", "!<", "!<=", "!<>", "!<>=", + "!=", "!>", "!>=", "$", "%", "%=", "&", "&&", "&=", "(", ")", "*", + "*=", "+", "++", "+=", "-", "--", "-=", ":", ";", "<", "<<", "<<=", + "<=", "<>", "<>=", "=", "==", "=>", ">", ">=", ">>", ">>=", ">>>", + ">>>=", "?", "@", "[", "]", "^", "^=", "^^", "^^=", "{", "|", "|=", "||", + "}", "~", "~=" + ]; + +} diff --git a/tests/knr/issue0024.d.ref b/tests/knr/issue0024.d.ref new file mode 100644 index 0000000..ca5ade0 --- /dev/null +++ b/tests/knr/issue0024.d.ref @@ -0,0 +1,4 @@ +complex_t opMul_r(real x) +{ + return complex_t(x) * this; +} diff --git a/tests/knr/issue0025.d.ref b/tests/knr/issue0025.d.ref new file mode 100644 index 0000000..eac4846 --- /dev/null +++ b/tests/knr/issue0025.d.ref @@ -0,0 +1,4 @@ +complex_t opMul(real y) +{ + return this * complex_t(y); +} diff --git a/tests/knr/issue0026.d.ref b/tests/knr/issue0026.d.ref new file mode 100644 index 0000000..902bfd9 --- /dev/null +++ b/tests/knr/issue0026.d.ref @@ -0,0 +1 @@ +extern (C++) int HtmlNamedEntity(const(char)* p, size_t length); diff --git a/tests/knr/issue0027.d.ref b/tests/knr/issue0027.d.ref new file mode 100644 index 0000000..cfa0a90 --- /dev/null +++ b/tests/knr/issue0027.d.ref @@ -0,0 +1,46 @@ +SignExtendedNumber opMul(const SignExtendedNumber a) const +{ + // like 0x10 * 0x10 == 0x100 == 0. + + /* Special handling for zeros: + */ +} + +unittest { + if (Port.isNan(r1) || Port.isNan(r2)) // if unordered + { + } + + while (cur && cur.ty == Tsarray) // sizes of dimensions + { + TypeSArray sa = cast(TypeSArray) cur; + mangleNumber(sa.dim ? sa.dim.toInteger() : 0); + cur = cur.nextOf(); + } + + if (fd) { + /* Use storage_class2 instead of storage_class otherwise when we do .di generation + * we'll wind up with 'const const' rather than 'const'. + */ + /* Don't think we need to worry about mutually exclusive storage classes here + */ + fd.storage_class2 |= stc; + } + +} + +SignExtendedNumber opMul(const SignExtendedNumber a) const +{ + /* Special handling for zeros: + */ + + // like 0x10 * 0x10 == 0x100 == 0. +} + +// Because int64_t and friends may be any integral type of the +// correct size, we have to explicitly ask for the correct +// integer type to get the correct mangling with ddmd + +// Be careful not to care about sign when using dinteger_t +// use this instead of integer_t to +// avoid conflicts with system #include's diff --git a/tests/knr/issue0028.d.ref b/tests/knr/issue0028.d.ref new file mode 100644 index 0000000..c96ee7b --- /dev/null +++ b/tests/knr/issue0028.d.ref @@ -0,0 +1,16 @@ +unittest { + if (imin.value > 0x10FFFFUL) // ?? + imin.value = 0x10FFFFUL; // ?? + with (stuff) switch (a) { + case a: + doStuff(); + break; + } + switch (a) { + } + if (something) /** whatever */ + doStuff(); + if (something) /+ comment +/ { + doStuff(); + } +} diff --git a/tests/knr/issue0029.d.ref b/tests/knr/issue0029.d.ref new file mode 100644 index 0000000..43327e0 --- /dev/null +++ b/tests/knr/issue0029.d.ref @@ -0,0 +1,3 @@ +unittest { + char** buf = cast(char**) mem.xmalloc(dim * (char*).sizeof); +} diff --git a/tests/knr/issue0030.d.ref b/tests/knr/issue0030.d.ref new file mode 100644 index 0000000..d4c8ba0 --- /dev/null +++ b/tests/knr/issue0030.d.ref @@ -0,0 +1,3 @@ +unittest { + tolower(*p); +} diff --git a/tests/knr/issue0031.d.ref b/tests/knr/issue0031.d.ref new file mode 100644 index 0000000..c9ea8ef --- /dev/null +++ b/tests/knr/issue0031.d.ref @@ -0,0 +1,6 @@ +import std.stdio : writeln; + +void main() +{ + writeln(cast(dchar)uint.max); +} diff --git a/tests/knr/issue0032.d.ref b/tests/knr/issue0032.d.ref new file mode 100644 index 0000000..9a6f97c --- /dev/null +++ b/tests/knr/issue0032.d.ref @@ -0,0 +1,7 @@ +SignExtendedNumber opSub(const SignExtendedNumber a) const +{ + if (a.isMinimum()) + return negative ? SignExtendedNumber(value, false) : max(); + else + return this + (-a); +} diff --git a/tests/knr/issue0033.d.ref b/tests/knr/issue0033.d.ref new file mode 100644 index 0000000..6595e59 --- /dev/null +++ b/tests/knr/issue0033.d.ref @@ -0,0 +1,14 @@ +static IntRange fromType(Type type, bool isUnsigned) +{ + if (type.toBasetype().ty == Tdchar) + upper.value = 0x10FFFFUL; + else if (!isUnsigned) { + lower.value = ~(mask >> 1); + lower.value = ~(mask >> 1); + lower.negative = true; + upper.value = (mask >> 1); + } + uinteger_t minHalfChunk = imin.value & ~halfChunkMask; + uinteger_t maxHalfChunk = imax.value & ~halfChunkMask; + return IntRange(lower, upper); +} diff --git a/tests/knr/issue0034.d.ref b/tests/knr/issue0034.d.ref new file mode 100644 index 0000000..f2a1838 --- /dev/null +++ b/tests/knr/issue0034.d.ref @@ -0,0 +1,10 @@ +unittest { + if (a.value == 0) { + if (a.negative) + return SignExtendedNumber(value == 0 && negative); + else + return extreme(negative); + } + + uinteger_t aAbs = copySign(a.value, a.negative); +} diff --git a/tests/knr/issue0035.d.ref b/tests/knr/issue0035.d.ref new file mode 100644 index 0000000..0394671 --- /dev/null +++ b/tests/knr/issue0035.d.ref @@ -0,0 +1,5 @@ +unittest { + if (some_very_long_expression && some_very_long_expression && + some_very_long_expression && some_very_long_expression && some_very_long_expression) { + } +} diff --git a/tests/knr/issue0037.d.ref b/tests/knr/issue0037.d.ref new file mode 100644 index 0000000..f9c8d79 --- /dev/null +++ b/tests/knr/issue0037.d.ref @@ -0,0 +1,15 @@ +class U { +private: + unittest { + Label: + int a = 0; + } +} + +unittest { + loop: while (true) { + doStuff(); + } +Label: { + } +} diff --git a/tests/knr/issue0038.d.ref b/tests/knr/issue0038.d.ref new file mode 100644 index 0000000..97d7dc8 --- /dev/null +++ b/tests/knr/issue0038.d.ref @@ -0,0 +1,5 @@ +static int isInfinity(double r) +{ + auto a = r is double.infinity || r is -double.infinity; + auto b = r is double.infinity || r !is -double.infinity; +} diff --git a/tests/knr/issue0039.d.ref b/tests/knr/issue0039.d.ref new file mode 100644 index 0000000..206b331 --- /dev/null +++ b/tests/knr/issue0039.d.ref @@ -0,0 +1 @@ +version (AArch64) int x = 10; diff --git a/tests/knr/issue0041.d.ref b/tests/knr/issue0041.d.ref new file mode 100644 index 0000000..df92dd3 --- /dev/null +++ b/tests/knr/issue0041.d.ref @@ -0,0 +1,2 @@ +static if (is(typeof(T.init.apply(fp, null)))) { +} diff --git a/tests/knr/issue0042.d.ref b/tests/knr/issue0042.d.ref new file mode 100644 index 0000000..b5837e1 --- /dev/null +++ b/tests/knr/issue0042.d.ref @@ -0,0 +1,12 @@ +unittest { + version (Windows) + __locale_decpoint = save; +} + +unittest { + version (Windows) + __locale_decpoint = save; + else + __locale_decpoint = save; + version (Win32) int x; +} diff --git a/tests/knr/issue0043.d.ref b/tests/knr/issue0043.d.ref new file mode 100644 index 0000000..c749e7a --- /dev/null +++ b/tests/knr/issue0043.d.ref @@ -0,0 +1,13 @@ +unittest { + switch (something) with (stuff) { + case 1: + case 2: + label: + doStuff(); + case 3: .. case 4: + doOtherStuff(); + goto label; + default: + break; + } +} diff --git a/tests/knr/issue0044.d.ref b/tests/knr/issue0044.d.ref new file mode 100644 index 0000000..b7950c8 --- /dev/null +++ b/tests/knr/issue0044.d.ref @@ -0,0 +1,5 @@ +enum Sizeok : int { + SIZEOKnone, // size of aggregate is not computed yet + SIZEOKdone, // size of aggregate is set correctly + SIZEOKfwd, // error in computing size of aggregate +} diff --git a/tests/knr/issue0045.d.ref b/tests/knr/issue0045.d.ref new file mode 100644 index 0000000..405827c --- /dev/null +++ b/tests/knr/issue0045.d.ref @@ -0,0 +1,7 @@ +void doStuff() +{ + for (;;) { + } + for (size_t i = 0; i < se.len;) { + } +} diff --git a/tests/knr/issue0046.d.ref b/tests/knr/issue0046.d.ref new file mode 100644 index 0000000..fdc36ad --- /dev/null +++ b/tests/knr/issue0046.d.ref @@ -0,0 +1,13 @@ +class C { + void func() + { + switch (x) { + default: + assert(0); + } + } + + void main(string[] args) + { + } +} diff --git a/tests/knr/issue0047.d.ref b/tests/knr/issue0047.d.ref new file mode 100644 index 0000000..91a3bf4 --- /dev/null +++ b/tests/knr/issue0047.d.ref @@ -0,0 +1,29 @@ +unittest { + + FuncDeclaration* pFd = cast(FuncDeclaration*) dmd_aaGet(&arrayfuncs, cast(void*) ident); + FuncDeclaration fd = *pFd; + { + auto dd = new DtorDeclaration(declLoc, Loc(), stc, Identifier.idPool("__fieldDtor")); + auto dd = new DtorDeclaration(declLoc, Loc(), stc, extraParam, + midLengthFun(param, param), longIdentifier, Identifier.idPool("__fieldDtor")); + + memcpy(&saved_idents, &rvl.saved_idents, (const(char)*).sizeof * VC_SAVED_IDENT_CNT); + memcpy(&saved_types, &rvl.saved_types, (Type).sizeof * VC_SAVED_TYPE_CNT); + + auto ed = new EnumDeclaration(loc, ident, memtype ? memtype.syntaxCopy() : null); + } +} + +void doStuff(const Token[] tokens, ref const State current, + const FormatterConfig* formatterConfig, int currentLineLength, int indentLevel, int depth) +{ + return; +} + +unittest { + if (x) { + if (y) { + auto z = doCond(e.thisexp) || doCond(e.newargs) || doCond(e.arguments) || applyTo(e); + } + } +} diff --git a/tests/knr/issue0048.d.ref b/tests/knr/issue0048.d.ref new file mode 100644 index 0000000..d960f6e --- /dev/null +++ b/tests/knr/issue0048.d.ref @@ -0,0 +1,5 @@ +@Shortcut("[shift] + [tab]") +@MenuItem("Text/Decrease") +void textDecreaseIndent(BufferView v) +{ +} diff --git a/tests/knr/issue0049.d.ref b/tests/knr/issue0049.d.ref new file mode 100644 index 0000000..4be6943 --- /dev/null +++ b/tests/knr/issue0049.d.ref @@ -0,0 +1,11 @@ +void main(string[] args) +{ + switch (value) { + case 0: + return null; + case 1: + // Indented comment + /* fall through */ + default: + } +} diff --git a/tests/knr/issue0050.d.ref b/tests/knr/issue0050.d.ref new file mode 100644 index 0000000..58f7328 --- /dev/null +++ b/tests/knr/issue0050.d.ref @@ -0,0 +1,19 @@ +void fun() +{ + if (something) + foreach (_; 0 .. 100) + if (true) { + if (stuff) + doStuff(); + else + morestuff(); + } else + doStuff(); + + cast(structalign_t) 1; + for (*cost = 0; sc; sc = sc.enclosing, (*cost)++) + if (sc.scopesym == scopesym) + break; + else + a++; +} diff --git a/tests/knr/issue0051.d.ref b/tests/knr/issue0051.d.ref new file mode 100644 index 0000000..4b4ea73 --- /dev/null +++ b/tests/knr/issue0051.d.ref @@ -0,0 +1,12 @@ +void f() +{ + if (a) { + } else // wat + { + if (!is_temp_arg_ref) { + if (global.params.isOSX) + buf.writeByte('_'); + } + } + return; +} diff --git a/tests/knr/issue0052.d.ref b/tests/knr/issue0052.d.ref new file mode 100644 index 0000000..4816bf1 --- /dev/null +++ b/tests/knr/issue0052.d.ref @@ -0,0 +1,8 @@ +enum Flags : int { + IS_NOT_TOP_TYPE = 0x1, + MANGLE_RETURN_TYPE = 0x2, + IGNORE_CONST = 0x4, + IS_DMC = 0x8, +} + +auto a = [b, c, d,]; diff --git a/tests/knr/issue0053.d.ref b/tests/knr/issue0053.d.ref new file mode 100644 index 0000000..d595a7e --- /dev/null +++ b/tests/knr/issue0053.d.ref @@ -0,0 +1,11 @@ +enum DYNCAST : int { + DYNCAST_OBJECT, + DYNCAST_EXPRESSION, + DYNCAST_DSYMBOL, + DYNCAST_TYPE, + DYNCAST_IDENTIFIER, + DYNCAST_TUPLE, + DYNCAST_PARAMETER, +} + +alias MATCHnomatch = MATCH.MATCHnomatch; diff --git a/tests/knr/issue0054.d.ref b/tests/knr/issue0054.d.ref new file mode 100644 index 0000000..464dfb9 --- /dev/null +++ b/tests/knr/issue0054.d.ref @@ -0,0 +1,26 @@ +struct ClassFlags { + alias Type = uint; + enum Enum : int { + isCOMclass = 0x1, + noPointers = 0x2, + hasOffTi = 0x4, + hasCtor = 0x8, + hasGetMembers = 0x10, + hasTypeInfo = 0x20, + isAbstract = 0x40, + isCPPclass = 0x80, + hasDtor = 0x100, + + } + + alias isCOMclass = Enum.isCOMclass; + alias noPointers = Enum.noPointers; + alias hasOffTi = Enum.hasOffTi; + alias hasCtor = Enum.hasCtor; + alias hasGetMembers = Enum.hasGetMembers; + alias hasTypeInfo = Enum.hasTypeInfo; + alias isAbstract = Enum.isAbstract; + alias isCPPclass = Enum.isCPPclass; + alias hasDtor = Enum.hasDtor; + +} diff --git a/tests/knr/issue0056.d.ref b/tests/knr/issue0056.d.ref new file mode 100644 index 0000000..a707a88 --- /dev/null +++ b/tests/knr/issue0056.d.ref @@ -0,0 +1,16 @@ +unittest { + { + { + } + } + { + } + { + { + { + { + } + } + } + } +} diff --git a/tests/knr/issue0057.d.ref b/tests/knr/issue0057.d.ref new file mode 100644 index 0000000..f97cd04 --- /dev/null +++ b/tests/knr/issue0057.d.ref @@ -0,0 +1,14 @@ +~this() +{ +} + +extern (C++) ~this() +{ + global.gag = oldgag; +} + +struct S { + public ~this() + { + } +} diff --git a/tests/knr/issue0058.d.ref b/tests/knr/issue0058.d.ref new file mode 100644 index 0000000..547d359 --- /dev/null +++ b/tests/knr/issue0058.d.ref @@ -0,0 +1,9 @@ +/******************************************************** + * Helper function for checkAccess() + * Returns: + * false is not accessible + * true is accessible + */ +extern (C++) static bool isAccessible() +{ +} diff --git a/tests/knr/issue0059.d.ref b/tests/knr/issue0059.d.ref new file mode 100644 index 0000000..eb29149 --- /dev/null +++ b/tests/knr/issue0059.d.ref @@ -0,0 +1,13 @@ +extern (C++) FuncDeclaration buildXopEquals(StructDeclaration sd, Scope* sc) +{ + if (!needOpEquals(sd)) + return null; // bitwise comparison would work + //printf("StructDeclaration::buildXopEquals() %s\n", sd->toChars()); + if (Dsymbol eq = search_function(sd, Id.eq)) { + if (FuncDeclaration fd = eq.isFuncDeclaration()) { + TypeFunction tfeqptr; + { + } + } + } +} diff --git a/tests/knr/issue0060.d.ref b/tests/knr/issue0060.d.ref new file mode 100644 index 0000000..65e25c3 --- /dev/null +++ b/tests/knr/issue0060.d.ref @@ -0,0 +1,4 @@ +static if (a) { +} else static if (b) { +} else { +} diff --git a/tests/knr/issue0061.d.ref b/tests/knr/issue0061.d.ref new file mode 100644 index 0000000..8d3c642 --- /dev/null +++ b/tests/knr/issue0061.d.ref @@ -0,0 +1 @@ +const(char)*[VC_SAVED_IDENT_CNT] saved_idents; diff --git a/tests/knr/issue0062.d.ref b/tests/knr/issue0062.d.ref new file mode 100644 index 0000000..02ded66 --- /dev/null +++ b/tests/knr/issue0062.d.ref @@ -0,0 +1,5 @@ +unittest { + switch (op) { + return -1; // memory blocks are different + } +} diff --git a/tests/knr/issue0063.d.ref b/tests/knr/issue0063.d.ref new file mode 100644 index 0000000..e670eb6 --- /dev/null +++ b/tests/knr/issue0063.d.ref @@ -0,0 +1,4 @@ +import ddmd.aggregate, ddmd.backend, ddmd.dclass, ddmd.declaration, + ddmd.dmodule, ddmd.dsymbol, ddmd.dtemplate, ddmd.expression, ddmd.func, + ddmd.globals, ddmd.identifier, ddmd.init, ddmd.mtype, ddmd.root.array, + ddmd.root.file, ddmd.root.rootobject, ddmd.statement; diff --git a/tests/knr/issue0064.d.ref b/tests/knr/issue0064.d.ref new file mode 100644 index 0000000..c62925a --- /dev/null +++ b/tests/knr/issue0064.d.ref @@ -0,0 +1,17 @@ +unittest { + return true; // +Lnomatch: + //printf("nomatch\n"); + return false; // nomatch; +} + +unittest { + if (x) + return true; +} + +unittest { + return true; // match +Lnomatch: //printf("nomatch\n"); + return false; // nomatch; +} diff --git a/tests/knr/issue0065.d.ref b/tests/knr/issue0065.d.ref new file mode 100644 index 0000000..4c5f443 --- /dev/null +++ b/tests/knr/issue0065.d.ref @@ -0,0 +1,7 @@ +void main(string[] args) +{ + if ((*tempdecl.parameters)[i].isTemplateThisParameter() is null) { + } + if (a() in b || a() is b) { + } +} diff --git a/tests/knr/issue0066.d.ref b/tests/knr/issue0066.d.ref new file mode 100644 index 0000000..8928906 --- /dev/null +++ b/tests/knr/issue0066.d.ref @@ -0,0 +1,8 @@ +int overloadApply(int function(void*, Dsymbol) fp) +{ +} + +void takesArray(int[]) +{ + doesntUseArray(); +} diff --git a/tests/knr/issue0067.d.ref b/tests/knr/issue0067.d.ref new file mode 100644 index 0000000..597acf0 --- /dev/null +++ b/tests/knr/issue0067.d.ref @@ -0,0 +1 @@ +alias Key = void*; diff --git a/tests/knr/issue0068.d.ref b/tests/knr/issue0068.d.ref new file mode 100644 index 0000000..084f9cb --- /dev/null +++ b/tests/knr/issue0068.d.ref @@ -0,0 +1,3 @@ +version (all) { +} else version (none) { +} diff --git a/tests/knr/issue0069.d.ref b/tests/knr/issue0069.d.ref new file mode 100644 index 0000000..994988a --- /dev/null +++ b/tests/knr/issue0069.d.ref @@ -0,0 +1,7 @@ +unittest { + if (0) { + L1: + if (0) { + } + } +} diff --git a/tests/knr/issue0070.d.ref b/tests/knr/issue0070.d.ref new file mode 100644 index 0000000..46d19e0 --- /dev/null +++ b/tests/knr/issue0070.d.ref @@ -0,0 +1,7 @@ +unittest { + if (0) + if (0) { + something(); + something_else(); + } +} diff --git a/tests/knr/issue0073.d.ref b/tests/knr/issue0073.d.ref new file mode 100644 index 0000000..6119049 --- /dev/null +++ b/tests/knr/issue0073.d.ref @@ -0,0 +1,7 @@ +void presumed(out uint column) @trusted +{ + CXString cxstring; + + clang_getPresumedLocation(cx, &cxstring, &line, &column); + filename = toD(cxstring); +} diff --git a/tests/knr/issue0074.d.ref b/tests/knr/issue0074.d.ref new file mode 100644 index 0000000..aec2963 --- /dev/null +++ b/tests/knr/issue0074.d.ref @@ -0,0 +1,13 @@ +@property bool isFunctionType() +{ + with (CXTypeKind) + return kind == CXType_FunctionNoProto || kind == CXType_FunctionProto + || // FIXME: This "hack" shouldn't be needed. + func.resultType.isValid; +} + +@property bool isFunctionPointerType() +{ + with (CXTypeKind) + return kind == CXType_Pointer && pointeeType.isFunctionType; +} diff --git a/tests/knr/issue0076.d.ref b/tests/knr/issue0076.d.ref new file mode 100644 index 0000000..9568ea5 --- /dev/null +++ b/tests/knr/issue0076.d.ref @@ -0,0 +1,5 @@ +unittest { +Label: + while (1) { + } +} diff --git a/tests/knr/issue0079.d.ref b/tests/knr/issue0079.d.ref new file mode 100644 index 0000000..f5c6553 --- /dev/null +++ b/tests/knr/issue0079.d.ref @@ -0,0 +1,8 @@ +unittest { + switch (x) { + case a: { + } + case b: + return; + } +} diff --git a/tests/knr/issue0080.d.ref b/tests/knr/issue0080.d.ref new file mode 100644 index 0000000..ae440b7 --- /dev/null +++ b/tests/knr/issue0080.d.ref @@ -0,0 +1,10 @@ +unittest { + switch (x) { + case a: + return; + version (A) { + case b: + return; + } + } +} diff --git a/tests/knr/issue0081.d.ref b/tests/knr/issue0081.d.ref new file mode 100644 index 0000000..532810f --- /dev/null +++ b/tests/knr/issue0081.d.ref @@ -0,0 +1,15 @@ +unittest { + if (0) + if (0) { + } else if (0) { + } else { + } + doSomething(); +} + +unittest { + if (0) + if (0) { + } + doSomething(); +} diff --git a/tests/knr/issue0082.d.ref b/tests/knr/issue0082.d.ref new file mode 100644 index 0000000..5206d17 --- /dev/null +++ b/tests/knr/issue0082.d.ref @@ -0,0 +1,10 @@ +unittest { +label: + if (x) { + } +Label: + + // comment + statement(); +} +} diff --git a/tests/knr/issue0083.d.ref b/tests/knr/issue0083.d.ref new file mode 100644 index 0000000..787506e --- /dev/null +++ b/tests/knr/issue0083.d.ref @@ -0,0 +1,5 @@ +bool contains(T item) +{ + asm pure nothrow @nogc { + } +} diff --git a/tests/knr/issue0085.d.ref b/tests/knr/issue0085.d.ref new file mode 100644 index 0000000..bc54606 --- /dev/null +++ b/tests/knr/issue0085.d.ref @@ -0,0 +1 @@ +alias T = typeof(return); diff --git a/tests/knr/issue0086.d.ref b/tests/knr/issue0086.d.ref new file mode 100644 index 0000000..fdb7297 --- /dev/null +++ b/tests/knr/issue0086.d.ref @@ -0,0 +1,22 @@ +unittest { + if (a) + if (b) + doSomething(); + doSomethingElse(); +} + +void indent() +{ + import std.range : repeat, take; + + if (config.useTabs) + foreach (i; 0 .. indentLevel + tempIndent) { + currentLineLength += config.tabSize; + output.put("\t"); + } else + foreach (i; 0 .. indentLevel + tempIndent) + foreach (j; 0 .. config.indentSize) { + output.put(" "); + currentLineLength++; + } +} diff --git a/tests/knr/issue0088.d.ref b/tests/knr/issue0088.d.ref new file mode 100644 index 0000000..4e8a338 --- /dev/null +++ b/tests/knr/issue0088.d.ref @@ -0,0 +1,7 @@ +unittest { + switch (x) { + case +1: + case -1: + case (1): + } +} diff --git a/tests/knr/issue0089.d.ref b/tests/knr/issue0089.d.ref new file mode 100644 index 0000000..b91fbde --- /dev/null +++ b/tests/knr/issue0089.d.ref @@ -0,0 +1,5 @@ +unittest { + if (x) + doSomething(); + //doSomethingElse(); +} diff --git a/tests/knr/issue0090.d.ref b/tests/knr/issue0090.d.ref new file mode 100644 index 0000000..16cb849 --- /dev/null +++ b/tests/knr/issue0090.d.ref @@ -0,0 +1,8 @@ +unittest { +L1: + switch (x) { + case Case: + doSomething(); + doSomethingElse(); + } +} diff --git a/tests/knr/issue0091.d.ref b/tests/knr/issue0091.d.ref new file mode 100644 index 0000000..89ff419 --- /dev/null +++ b/tests/knr/issue0091.d.ref @@ -0,0 +1,10 @@ +unittest { + switch (x) { + version (none) { + x(); + case Case: + doSomething(); + doSomethingElse(); + } + } +} diff --git a/tests/knr/issue0092.d.ref b/tests/knr/issue0092.d.ref new file mode 100644 index 0000000..52fc7a0 --- /dev/null +++ b/tests/knr/issue0092.d.ref @@ -0,0 +1,15 @@ +unittest { + switch (cast(uint) sz) { + case 3: + if (!global.params.is64bit) + goto Lmemory; + case 4: + t1 = Type.tint32; + break; + case 5: + if (!global.params.is64bit) + goto Lmemory; + default: + break; + } +} diff --git a/tests/knr/issue0093.d.ref b/tests/knr/issue0093.d.ref new file mode 100644 index 0000000..4188bc2 --- /dev/null +++ b/tests/knr/issue0093.d.ref @@ -0,0 +1,7 @@ +unittest { + if (x) { + version (none) { + } else { + } + } +} diff --git a/tests/knr/issue0094.d.ref b/tests/knr/issue0094.d.ref new file mode 100644 index 0000000..0a70537 --- /dev/null +++ b/tests/knr/issue0094.d.ref @@ -0,0 +1,6 @@ +void test() +{ + fun((int x) { writeln(x); }, (int x) { writeln(x); }); + + return; +} diff --git a/tests/knr/issue0095.d.ref b/tests/knr/issue0095.d.ref new file mode 100644 index 0000000..453b074 --- /dev/null +++ b/tests/knr/issue0095.d.ref @@ -0,0 +1,6 @@ +unittest { + if (!fdmatch) + goto Lfd; + { + } +} diff --git a/tests/knr/issue0096.d.ref b/tests/knr/issue0096.d.ref new file mode 100644 index 0000000..441e7d9 --- /dev/null +++ b/tests/knr/issue0096.d.ref @@ -0,0 +1,13 @@ +version (Windows) void func(); +version (Windows) + void func(); +else + void func(); +version (Windows) { + void func(); +} +version (Windows) { + void func(); +} else { + void func(); +} diff --git a/tests/knr/issue0097.d.ref b/tests/knr/issue0097.d.ref new file mode 100644 index 0000000..c43ea0d --- /dev/null +++ b/tests/knr/issue0097.d.ref @@ -0,0 +1,33 @@ +unittest { + switch (x) { + case 0: + version (none) { + // Comment + case '\n': + break; + } + } +} + +unittest { + switch (x) { + case 0: { + Label: while (1) { + } + break; + } + Label2: + doStuff(); + } +} + +unittest { + switch (a) { + case a: + doStuff(); + doOtherStuff(); + break; + default: + break; + } +} diff --git a/tests/knr/issue0098.d.ref b/tests/knr/issue0098.d.ref new file mode 100644 index 0000000..ecb4ff9 --- /dev/null +++ b/tests/knr/issue0098.d.ref @@ -0,0 +1,6 @@ +unittest { + if (!fdmatch) + goto Lfd; // comment + { + } +} diff --git a/tests/knr/issue0099.d.ref b/tests/knr/issue0099.d.ref new file mode 100644 index 0000000..b615aa9 --- /dev/null +++ b/tests/knr/issue0099.d.ref @@ -0,0 +1,31 @@ +unittest { + if (a) { + if (b) + if (c) { + if (excessivelyLongVariableName.longAttributeName + && excessivelyLongVariableName.longAttributeName + && excessivelyLongVariableName.longAttributeName) + excessivelyLongFunctionName(true); + else { + excessivelyLongFunctionName(false); + } + } else + a(); + } +} + +unittest { + if (a) { + if (b) { + if (c) { + if (excessivelyLongVariableName.longAttributeName + && excessivelyLongVariableName.longAttributeName + && excessivelyLongVariableName.longAttributeName) + excessivelyLongFunctionName(true); + else { + excessivelyLongFunctionName(false); + } + } + } + } +} diff --git a/tests/knr/issue0100.d.ref b/tests/knr/issue0100.d.ref new file mode 100644 index 0000000..15f5cfa --- /dev/null +++ b/tests/knr/issue0100.d.ref @@ -0,0 +1,12 @@ +unittest { + loop: while (i < tokens.length) switch (tokens[i].type) { + case tok!"(": + parenDepth++; + i++; + break; + case tok!"{": + braceDepth++; + i++; + break; + } +} diff --git a/tests/knr/issue0101.d.ref b/tests/knr/issue0101.d.ref new file mode 100644 index 0000000..5d2e5fc --- /dev/null +++ b/tests/knr/issue0101.d.ref @@ -0,0 +1,9 @@ +#! /usr/bin/env rdmd + +import std.stdio : writeln; + +int main(immutable string[] args) +{ + writeln("Hello World!"); + return 0; +} diff --git a/tests/knr/issue0102.d.ref b/tests/knr/issue0102.d.ref new file mode 100644 index 0000000..8efd670 --- /dev/null +++ b/tests/knr/issue0102.d.ref @@ -0,0 +1 @@ +import std.stdio: stderr; diff --git a/tests/knr/issue0106.d.ref b/tests/knr/issue0106.d.ref new file mode 100644 index 0000000..9045b4f --- /dev/null +++ b/tests/knr/issue0106.d.ref @@ -0,0 +1,2 @@ +enum : int { +} diff --git a/tests/knr/issue0107.d.ref b/tests/knr/issue0107.d.ref new file mode 100644 index 0000000..045f087 --- /dev/null +++ b/tests/knr/issue0107.d.ref @@ -0,0 +1,14 @@ +void msgpackToGValue(MsgValue input) +{ + with (MsgValue.Type) switch (input.type) { + case boolean: + a(); + break; + case unsigned: + b(); + break; + default: + assert(false); + } + return retVal; +} diff --git a/tests/knr/issue0108.d.ref b/tests/knr/issue0108.d.ref new file mode 100644 index 0000000..1c120a1 --- /dev/null +++ b/tests/knr/issue0108.d.ref @@ -0,0 +1,10 @@ +unittest { + with (SomeEnum) final switch (value) { + case a: + aa(); + break; + case b: + bb(); + break; + } +} diff --git a/tests/knr/issue0109.d.ref b/tests/knr/issue0109.d.ref new file mode 100644 index 0000000..43e04fc --- /dev/null +++ b/tests/knr/issue0109.d.ref @@ -0,0 +1,5 @@ +unittest { + sourceLoop: for (; childCodes.length > 0 && sourceListStore.iterIsValid(sourceIter); + sourceListStore.iterNext(sourceIter)) { + } +} diff --git a/tests/knr/issue0111.d.ref b/tests/knr/issue0111.d.ref new file mode 100644 index 0000000..3f13a34 --- /dev/null +++ b/tests/knr/issue0111.d.ref @@ -0,0 +1,7 @@ +struct Test { + this(string name, string[] aliasList, string briefDescription, string examDesc, string onOpenDesc, + string openDesc, string onCloseDesc, string closeDesc, + Flag!"canOpen" canOpen, Flag!"canClose" canClose, Flag!"isOpen" isOpen) + { + } +} diff --git a/tests/knr/issue0112.d.ref b/tests/knr/issue0112.d.ref new file mode 100644 index 0000000..6977857 --- /dev/null +++ b/tests/knr/issue0112.d.ref @@ -0,0 +1,13 @@ +unittest { + testScene = new Scene("TestScene : Test", sceneDescriptions["TestScene"], + connectDescriptions["TestScene"], delegate(Scene scene) { + import std.stdio; + + if (!scene.alreadyEntered) { + fwriteln( + "This is a test. This is a test. This is a test. This is a test. This is a test. Test12."); + auto p = cast(Portal) sceneManager.previousScene; + scene.destroyCurrentScript(); + } + }); +} diff --git a/tests/knr/issue0112_variation.d.ref b/tests/knr/issue0112_variation.d.ref new file mode 100644 index 0000000..424c1dd --- /dev/null +++ b/tests/knr/issue0112_variation.d.ref @@ -0,0 +1,13 @@ +unittest { + testScene = new Scene(longArgument, longArgument, longArgument, + longArgument, longArgument, longArgument, delegate(Scene scene) { + import std.stdio; + + if (!scene.alreadyEntered) { + fwriteln( + "This is a test. This is a test. This is a test. This is a test. This is a test. Test12."); + auto p = cast(Portal) sceneManager.previousScene; + scene.destroyCurrentScript(); + } + }); +} diff --git a/tests/knr/issue0114.d.ref b/tests/knr/issue0114.d.ref new file mode 100644 index 0000000..ae34f97 --- /dev/null +++ b/tests/knr/issue0114.d.ref @@ -0,0 +1,4 @@ +private { + import std.process; + import std.c.windows.windows; +} diff --git a/tests/knr/issue0116.d.ref b/tests/knr/issue0116.d.ref new file mode 100644 index 0000000..c8b6a99 --- /dev/null +++ b/tests/knr/issue0116.d.ref @@ -0,0 +1,7 @@ +static assert(!is(T : int)); + +unittest { + foo(!is(T : int)); +} + +enum a(T) = !is(T : int); diff --git a/tests/knr/issue0117.d.ref b/tests/knr/issue0117.d.ref new file mode 100644 index 0000000..d6fa3cb --- /dev/null +++ b/tests/knr/issue0117.d.ref @@ -0,0 +1,6 @@ +struct A { + int i; // Comment + ~this() + { + } +} diff --git a/tests/knr/issue0118.d.ref b/tests/knr/issue0118.d.ref new file mode 100644 index 0000000..c27fb60 --- /dev/null +++ b/tests/knr/issue0118.d.ref @@ -0,0 +1,14 @@ +auto foo = bar(1, 1, 1); +auto foo = A!(int, int, int); +enum foo = bar(1, 1, 1); +enum foo = A!(int, int, int); + +enum bar { + a = Struct(a, b, c), + b = Struct(d, e, f) +} + +enum bar { + a = Struct(a, b, c), + b = Struct(d, e, f), +} diff --git a/tests/knr/issue0119.d.ref b/tests/knr/issue0119.d.ref new file mode 100644 index 0000000..9f0d8d1 --- /dev/null +++ b/tests/knr/issue0119.d.ref @@ -0,0 +1,24 @@ +auto fun = function() {}; +auto fun = () {}; +auto fun = {}; + +auto fun = { int i; }; + +auto fun = { int i; int i; int i; int i; }; + +unittest { + callFunc({ int i = 10; return i; }); + callFunc({ + int i = 10; + foo(alpha, bravo, charlie, delta, echo, foxtrot, golf, echo); + doStuff(withThings, andOtherStuff); + return i; + }); + callFunc({ + int i = 10; + foo(alpha_longVarName, bravo_longVarName, charlie_longVarName, delta_longVarName, + echo_longVarName, foxtrot_longVarName, golf_longVarName, echo_longVarName); + doStuff(withThings, andOtherStuff); + return i; + }, more_stuff); +} diff --git a/tests/knr/issue0120.d.ref b/tests/knr/issue0120.d.ref new file mode 100644 index 0000000..c3b6313 --- /dev/null +++ b/tests/knr/issue0120.d.ref @@ -0,0 +1,3 @@ +auto fun = { + int i; // Comment +}; diff --git a/tests/knr/issue0123.d.ref b/tests/knr/issue0123.d.ref new file mode 100644 index 0000000..e91a9c8 --- /dev/null +++ b/tests/knr/issue0123.d.ref @@ -0,0 +1,6 @@ +struct State { + this(uint breaks, const Token[] tokens, immutable short[] depths, + const Config* config, int currentLineLength, int indentLevel) pure @safe + { + } +} diff --git a/tests/knr/issue0125.d.ref b/tests/knr/issue0125.d.ref new file mode 100644 index 0000000..ce47f77 --- /dev/null +++ b/tests/knr/issue0125.d.ref @@ -0,0 +1,11 @@ +void main(string[] args) +{ + // dfmt off + getopt(args, + "optionOne", &optionOne, + "optionTwo", &optionTwo, + "optionThree", &optionThree); + // dfmt on + + getopt(args, "optionOne", &optionOne, "optionTwo", &optionTwo, "optionThree", &optionThree); +} diff --git a/tests/knr/issue0126.d.ref b/tests/knr/issue0126.d.ref new file mode 100644 index 0000000..a79c876 --- /dev/null +++ b/tests/knr/issue0126.d.ref @@ -0,0 +1,6 @@ +unittest { + try + doStuff(); + catch (Exception ex) + complain(ex.msg); +} diff --git a/tests/knr/issue0127.d.ref b/tests/knr/issue0127.d.ref new file mode 100644 index 0000000..a6b95af --- /dev/null +++ b/tests/knr/issue0127.d.ref @@ -0,0 +1,4 @@ +version (Windows) + enum root = `C:\`; +else + enum root = "/"; diff --git a/tests/knr/issue0128.d.ref b/tests/knr/issue0128.d.ref new file mode 100644 index 0000000..0b1261c --- /dev/null +++ b/tests/knr/issue0128.d.ref @@ -0,0 +1,4 @@ +unittest { + string[string] aa = ["a" : "b"]; + auto x = "a" in aa; +} diff --git a/tests/knr/issue0130.d.ref b/tests/knr/issue0130.d.ref new file mode 100644 index 0000000..616293a --- /dev/null +++ b/tests/knr/issue0130.d.ref @@ -0,0 +1,10 @@ +class SomeClass { + public: + int x; + int y; + private: + int z; +} + +public: + void doStuff(); diff --git a/tests/knr/issue0134.d.ref b/tests/knr/issue0134.d.ref new file mode 100644 index 0000000..9d10648 --- /dev/null +++ b/tests/knr/issue0134.d.ref @@ -0,0 +1,14 @@ +void foo() +{ + string command; + version (Posix) + command ~= " 2> /dev/null 1> /dev/null"; + + version (Posix) + command ~= " 2> /dev/null 1> /dev/null"; + + unittest { + version (Posix) + command ~= " 2> /dev/null 1> /dev/null"; + } +} diff --git a/tests/knr/issue0136.d.ref b/tests/knr/issue0136.d.ref new file mode 100644 index 0000000..9f04038 --- /dev/null +++ b/tests/knr/issue0136.d.ref @@ -0,0 +1,3 @@ +unittest { + auto result = name !in aa; +} diff --git a/tests/knr/issue0138.d.ref b/tests/knr/issue0138.d.ref new file mode 100644 index 0000000..4f1d05b --- /dev/null +++ b/tests/knr/issue0138.d.ref @@ -0,0 +1,7 @@ +unittest { + auto result = a[0] in aa; +} + +void doStuff(in int a, in int b) +{ +} diff --git a/tests/knr/issue0139.d.ref b/tests/knr/issue0139.d.ref new file mode 100644 index 0000000..938bb75 --- /dev/null +++ b/tests/knr/issue0139.d.ref @@ -0,0 +1,24 @@ +void foo(auto in a, auto out int b) const +out { + assert(true); +} +body { +} + +void foo() const +in { +} +out { + assert(true); +} +body { +} + +void foo() const +in { +} +out (result) { + assert(true); +} +body { +} diff --git a/tests/knr/issue0140.d.ref b/tests/knr/issue0140.d.ref new file mode 100644 index 0000000..471bf96 --- /dev/null +++ b/tests/knr/issue0140.d.ref @@ -0,0 +1,5 @@ +class C { + + int foo; + +} diff --git a/tests/knr/issue0142.d.ref b/tests/knr/issue0142.d.ref new file mode 100644 index 0000000..0ff0108 --- /dev/null +++ b/tests/knr/issue0142.d.ref @@ -0,0 +1,3 @@ +class Bar(A) : Foo if (isFloating!A) { + +} diff --git a/tests/knr/issue0146.d.ref b/tests/knr/issue0146.d.ref new file mode 100644 index 0000000..9854d89 --- /dev/null +++ b/tests/knr/issue0146.d.ref @@ -0,0 +1 @@ +alias FooFactory = Foo delegate(); diff --git a/tests/knr/issue0147.d.ref b/tests/knr/issue0147.d.ref new file mode 100644 index 0000000..df7761e --- /dev/null +++ b/tests/knr/issue0147.d.ref @@ -0,0 +1 @@ +import ae.utils.meta : singleton, I; diff --git a/tests/knr/issue0148.d.ref b/tests/knr/issue0148.d.ref new file mode 100644 index 0000000..9b4cb05 --- /dev/null +++ b/tests/knr/issue0148.d.ref @@ -0,0 +1,6 @@ +class Foo { + @property Socket socket() + { + return this.socket; + } +} diff --git a/tests/knr/issue0150.d.ref b/tests/knr/issue0150.d.ref new file mode 100644 index 0000000..c4a484c --- /dev/null +++ b/tests/knr/issue0150.d.ref @@ -0,0 +1,5 @@ +void main() +{ + scope (success) { + } +} diff --git a/tests/knr/issue0151.d.ref b/tests/knr/issue0151.d.ref new file mode 100644 index 0000000..639e6bb --- /dev/null +++ b/tests/knr/issue0151.d.ref @@ -0,0 +1,7 @@ +void test() +{ /* ignore */ } + +void test2() +{ + test(); +} diff --git a/tests/knr/issue0152.d.ref b/tests/knr/issue0152.d.ref new file mode 100644 index 0000000..d6a32a2 --- /dev/null +++ b/tests/knr/issue0152.d.ref @@ -0,0 +1 @@ +enum IsPathHandler(alias T) = is(PathHandler == typeof(T)); diff --git a/tests/knr/issue0153.d.ref b/tests/knr/issue0153.d.ref new file mode 100644 index 0000000..86bbf90 --- /dev/null +++ b/tests/knr/issue0153.d.ref @@ -0,0 +1,6 @@ +class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName + if (is(T : Bar)) { + void foo() + { + } +} diff --git a/tests/knr/issue0154.d.ref b/tests/knr/issue0154.d.ref new file mode 100644 index 0000000..14d242d --- /dev/null +++ b/tests/knr/issue0154.d.ref @@ -0,0 +1,5 @@ +class Foo(T) if (is(T : Bar) && is(T : Baz)) { +} + +class Foo(T) if (is(T : Bar) || is(T : Baz)) { +} diff --git a/tests/knr/issue0155.d.ref b/tests/knr/issue0155.d.ref new file mode 100644 index 0000000..ee25a4d --- /dev/null +++ b/tests/knr/issue0155.d.ref @@ -0,0 +1,3 @@ +import foo; +public import bar; +import baz; diff --git a/tests/knr/issue0156.d.ref b/tests/knr/issue0156.d.ref new file mode 100644 index 0000000..01b5abd --- /dev/null +++ b/tests/knr/issue0156.d.ref @@ -0,0 +1,7 @@ +class C { + int foo() const + out (bar) { + } + body { + } +} diff --git a/tests/knr/issue0158.d.ref b/tests/knr/issue0158.d.ref new file mode 100644 index 0000000..c81b98e --- /dev/null +++ b/tests/knr/issue0158.d.ref @@ -0,0 +1,6 @@ +@Foo enum Bar { + a +} + +@foo class Baz { +} diff --git a/tests/knr/issue0162.d.ref b/tests/knr/issue0162.d.ref new file mode 100644 index 0000000..cc9715b --- /dev/null +++ b/tests/knr/issue0162.d.ref @@ -0,0 +1,8 @@ +void foo(int foobarbazqux1, /* */ + int foobarbazqux2, /* */ + int foobarbazqux3, /* */ + int foobarbazqux4, /* */ + int foobarbazqux5, /* */ + int foobarbazqux6, /* */ + int foobarbazqux7 /* */ +); diff --git a/tests/knr/issue0166.d.ref b/tests/knr/issue0166.d.ref new file mode 100644 index 0000000..f1d209f --- /dev/null +++ b/tests/knr/issue0166.d.ref @@ -0,0 +1,9 @@ +void foo() +{ // + void bar() + { // + baz({ // + qux(); // + }); // + } // +} // diff --git a/tests/knr/issue0169.d.ref b/tests/knr/issue0169.d.ref new file mode 100644 index 0000000..6d99247 --- /dev/null +++ b/tests/knr/issue0169.d.ref @@ -0,0 +1,10 @@ +unittest { + if (true) { + if (true) // comment + { + + } else { + + } + } +} diff --git a/tests/knr/issue0172.d.ref b/tests/knr/issue0172.d.ref new file mode 100644 index 0000000..b50c1b3 --- /dev/null +++ b/tests/knr/issue0172.d.ref @@ -0,0 +1,6 @@ +final class FormatVisitor : ASTVisitor { + this(ASTInformation* astInformation) + { + this.astInformation = astInformation; + } +} diff --git a/tests/knr/issue0174.d.ref b/tests/knr/issue0174.d.ref new file mode 100644 index 0000000..1a95194 --- /dev/null +++ b/tests/knr/issue0174.d.ref @@ -0,0 +1,5 @@ +void merge() +{ + static if (is(T == enum)) + *thisN = x; +} diff --git a/tests/knr/issue0177.d.ref b/tests/knr/issue0177.d.ref new file mode 100644 index 0000000..c2bbe3c --- /dev/null +++ b/tests/knr/issue0177.d.ref @@ -0,0 +1,26 @@ +unittest { + { + } + // + { + } +} + +unittest { + { + } + // + + { + } +} + +unittest { + { + } + + // + + { + } +} diff --git a/tests/knr/issue0185.d.ref b/tests/knr/issue0185.d.ref new file mode 100644 index 0000000..8932e46 --- /dev/null +++ b/tests/knr/issue0185.d.ref @@ -0,0 +1,12 @@ +unittest { + do + ++a; + while (true); +} + +unittest { + do { + ++a; + } + while (true); +} diff --git a/tests/knr/issue0186.d.ref b/tests/knr/issue0186.d.ref new file mode 100644 index 0000000..952a8af --- /dev/null +++ b/tests/knr/issue0186.d.ref @@ -0,0 +1,23 @@ +void functionName() +{ + +} + +void main() +{ + static if (true) { + if (true && { + functionName(); + functionName(); + functionName(); + functionName(); + return true; + }()) { + + } else { + + } + } else { + + } +} diff --git a/tests/knr/issue0187.d.ref b/tests/knr/issue0187.d.ref new file mode 100644 index 0000000..ee3cdbf --- /dev/null +++ b/tests/knr/issue0187.d.ref @@ -0,0 +1,3 @@ +void doStuff(T)() @safe if (isNumeric!T) +{ +} diff --git a/tests/knr/issue0189.d.ref b/tests/knr/issue0189.d.ref new file mode 100644 index 0000000..ff680f2 --- /dev/null +++ b/tests/knr/issue0189.d.ref @@ -0,0 +1,17 @@ +unittest { + Test("Something") in { + abcde_abcde_abcde(); + abcde_abcde_abcde(); + abcde_abcde_abcde(); + abcde_abcde_abcde(); + abcde_abcde_abcde(); + abcde_abcde_abcde(); + }; +} + +void aFunction(ParamType param) +in { + assert(stuff); +} +body { +} diff --git a/tests/knr/issue0190.d.ref b/tests/knr/issue0190.d.ref new file mode 100644 index 0000000..ed0d398 --- /dev/null +++ b/tests/knr/issue0190.d.ref @@ -0,0 +1,6 @@ +unittest { + asm { + dl 12345; + movdqu [R8], XMM0; + } +} diff --git a/tests/knr/issue0194.d.ref b/tests/knr/issue0194.d.ref new file mode 100644 index 0000000..6311e9a --- /dev/null +++ b/tests/knr/issue0194.d.ref @@ -0,0 +1,10 @@ +module test; + +void main() +{ + test("stringLiteral") in { + foreach (thing; things) { + doStuff(thing); + } + }; +} diff --git a/tests/knr/issue0195.d.ref b/tests/knr/issue0195.d.ref new file mode 100644 index 0000000..bfd97c3 --- /dev/null +++ b/tests/knr/issue0195.d.ref @@ -0,0 +1,15 @@ +void main() +{ + auto myTid = runTask({ + auto conn = connectTCP("localhost", 4222); + + auto l = Lexer(conn); + foreach (t; l) { + + } + conn.close(); + }); + + // foo + runEventLoop(); +} diff --git a/tests/knr/issue0204.d.ref b/tests/knr/issue0204.d.ref new file mode 100644 index 0000000..adab749 --- /dev/null +++ b/tests/knr/issue0204.d.ref @@ -0,0 +1,10 @@ +version (Foo) { + version (D_Version2) { + public import core.memory; + } else: +} + +version (Bar) + int foo(); +else: + int foo(int); diff --git a/tests/knr/issue0205.d.ref b/tests/knr/issue0205.d.ref new file mode 100644 index 0000000..a7f02f6 --- /dev/null +++ b/tests/knr/issue0205.d.ref @@ -0,0 +1,6 @@ +unittest { + asm { + } + d[] = a[]; + c[] = d[]; +} diff --git a/tests/knr/issue0206.d.ref b/tests/knr/issue0206.d.ref new file mode 100644 index 0000000..b0ec36a --- /dev/null +++ b/tests/knr/issue0206.d.ref @@ -0,0 +1,7 @@ +unittest { + import std.stdio : stderr; + + { + a = 10; + } +} diff --git a/tests/knr/issue0207.d.ref b/tests/knr/issue0207.d.ref new file mode 100644 index 0000000..5b779d8 --- /dev/null +++ b/tests/knr/issue0207.d.ref @@ -0,0 +1,10 @@ +enum a { + a, + b, + c, + d, + /* a comment */ + e, + f, + g +} diff --git a/tests/knr/issue0208.d.ref b/tests/knr/issue0208.d.ref new file mode 100644 index 0000000..379e02c --- /dev/null +++ b/tests/knr/issue0208.d.ref @@ -0,0 +1,5 @@ +unittest { + if (a && !is(b == q)) { + + } +} diff --git a/tests/knr/issue0209.d.ref b/tests/knr/issue0209.d.ref new file mode 100644 index 0000000..1bcfcd6 --- /dev/null +++ b/tests/knr/issue0209.d.ref @@ -0,0 +1,18 @@ +unittest { + { + public Vector!(T) opBinary(string op, string file = __FILE__, size_t line = __LINE__)( + const Vector!(T) x) const if (op == "*") + in { + } + body { + } + + } +} + +public Vector!(T) opBinary(string op, string file = __FILE__, size_t line = __LINE__)( + const Vector!(T) x) const if (op == "*") +in { +} +body { +} diff --git a/tests/knr/issue0210.d.ref b/tests/knr/issue0210.d.ref new file mode 100644 index 0000000..afef07a --- /dev/null +++ b/tests/knr/issue0210.d.ref @@ -0,0 +1,2 @@ +static assert(call(x) !is y); +static assert(call(x) is y); diff --git a/tests/knr/issue0212.d.ref b/tests/knr/issue0212.d.ref new file mode 100644 index 0000000..3f2df8e --- /dev/null +++ b/tests/knr/issue0212.d.ref @@ -0,0 +1,3 @@ +enum { + x = 3 +} diff --git a/tests/knr/issue0213.d.ref b/tests/knr/issue0213.d.ref new file mode 100644 index 0000000..b32eda7 --- /dev/null +++ b/tests/knr/issue0213.d.ref @@ -0,0 +1,6 @@ +version (linux) + import core.sys.linux.elf; +else version (FreeBSD) + import core.sys.freebsd.sys.elf; +else version (Solaris) + import core.sys.solaris.elf; diff --git a/tests/knr/issue0215a.d.ref b/tests/knr/issue0215a.d.ref new file mode 100644 index 0000000..96e2d7e --- /dev/null +++ b/tests/knr/issue0215a.d.ref @@ -0,0 +1,17 @@ +module example; + +bool aTemplatedFunction(One)(One alpha) if (isNumeric!One) +{ +} + +unittest { + { + bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, + Three charlie, double delta) + if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo + && foxtrot && golf && hotel && india && juliet) + { + + } + } +} diff --git a/tests/knr/issue0215b.d.ref b/tests/knr/issue0215b.d.ref new file mode 100644 index 0000000..59ff341 --- /dev/null +++ b/tests/knr/issue0215b.d.ref @@ -0,0 +1,17 @@ +module example; + +bool aTemplatedFunction(One)(One alpha) if (isNumeric!One) +{ +} + +unittest { + { + bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, + Three charlie, double delta) + if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo + && foxtrot && golf && hotel && india && juliet) + { + + } + } +} diff --git a/tests/knr/issue0215c.d.ref b/tests/knr/issue0215c.d.ref new file mode 100644 index 0000000..9a00fa1 --- /dev/null +++ b/tests/knr/issue0215c.d.ref @@ -0,0 +1,18 @@ +module example; + +bool aTemplatedFunction(One)(One alpha) +if (isNumeric!One) +{ +} + +unittest { + { + bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, + Three charlie, double delta) + if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo + && foxtrot && golf && hotel && india && juliet) + { + + } + } +} diff --git a/tests/knr/issue0215d.d.ref b/tests/knr/issue0215d.d.ref new file mode 100644 index 0000000..2d52919 --- /dev/null +++ b/tests/knr/issue0215d.d.ref @@ -0,0 +1,18 @@ +module example; + +bool aTemplatedFunction(One)(One alpha) + if (isNumeric!One) +{ +} + +unittest { + { + bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo, + Three charlie, double delta) + if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo + && foxtrot && golf && hotel && india && juliet) + { + + } + } +} diff --git a/tests/knr/issue0216.d.ref b/tests/knr/issue0216.d.ref new file mode 100644 index 0000000..20d86fb --- /dev/null +++ b/tests/knr/issue0216.d.ref @@ -0,0 +1,5 @@ +unittest { + if (something || somethingElse || // I like putting comments here for no good reason + thirdThing) { + } +} diff --git a/tests/knr/issue0219.d.ref b/tests/knr/issue0219.d.ref new file mode 100644 index 0000000..cfab244 --- /dev/null +++ b/tests/knr/issue0219.d.ref @@ -0,0 +1,5 @@ +@OneOf("group1") { + JSONValue[string] fred; + bool mertz; + bool ethel; +} diff --git a/tests/knr/issue0220.d.ref b/tests/knr/issue0220.d.ref new file mode 100644 index 0000000..568c640 --- /dev/null +++ b/tests/knr/issue0220.d.ref @@ -0,0 +1,67 @@ +static if (someCondition) + void doStuff() + { + } +else + void doStuff() + { + } + +static if (someCondition) + void doStuff() + { + } +else static if (otherCondition) + void doStuff() + { + } + +static if (someCondition) + void doStuff() + { + } +else static if (otherCondition) + void doStuff() + { + } +else + void doStuff() + { + } + +static if (condition) + int a; +else + int b; + +static if (condition) + int a; +else static if (otherCondition) + int c; +else + int b; + +void doStuff(); + +static if (stuff) + int a; +else + class C { + public: + void aFunction(); + private: + int a; + int b; + } + +static if (condition) + int a; +else + int b; + +static if (condition) + int a; +else static if (otherCondition) + int c; +else + int b; diff --git a/tests/knr/issue0221.d.ref b/tests/knr/issue0221.d.ref new file mode 100644 index 0000000..a036bb7 --- /dev/null +++ b/tests/knr/issue0221.d.ref @@ -0,0 +1,4 @@ +unittest { + static if (stuff) // comment + things(); +} diff --git a/tests/knr/issue0222.d.ref b/tests/knr/issue0222.d.ref new file mode 100644 index 0000000..09a8058 --- /dev/null +++ b/tests/knr/issue0222.d.ref @@ -0,0 +1,4 @@ +unittest { + return (complicated % expression) / //------------------- + (other * complicated + expression); +} diff --git a/tests/knr/issue0223.d.ref b/tests/knr/issue0223.d.ref new file mode 100644 index 0000000..fc6f351 --- /dev/null +++ b/tests/knr/issue0223.d.ref @@ -0,0 +1,6 @@ +unittest { + if (info > 0) + throw new ExceptionWithLongName(std.string.format( + "During the LU factorization, it was found that the " ~ "%sth diagonal value is exactly zero.", + info), file, line); +} diff --git a/tests/knr/issue0224.d.ref b/tests/knr/issue0224.d.ref new file mode 100644 index 0000000..c0e868a --- /dev/null +++ b/tests/knr/issue0224.d.ref @@ -0,0 +1,5 @@ +unittest { + int a, /// comment + b, /// comment + c; /// comment +} diff --git a/tests/knr/issue0225.d.ref b/tests/knr/issue0225.d.ref new file mode 100644 index 0000000..b9ee234 --- /dev/null +++ b/tests/knr/issue0225.d.ref @@ -0,0 +1,4 @@ +static if (condition) + int declaration; +else { +} diff --git a/tests/knr/issue0226.d.ref b/tests/knr/issue0226.d.ref new file mode 100644 index 0000000..3406742 --- /dev/null +++ b/tests/knr/issue0226.d.ref @@ -0,0 +1,14 @@ +unittest { + auto a = 1234567890 + 1234567890 + 1234567890 + 1234567890 + 1234567890 + + 1234567890 + 1234567890 + 1234567890 + 1234567890 + 1234567890 + + 1234567890 + 1234567890 + 1234567890 + 1234567890 + 1234567890 + + 1234567890 + 1234567890 + 1234567890; + auto a = 1234567890 - 1234567890 - 1234567890 - 1234567890 - 1234567890 + - 1234567890 - 1234567890 - 1234567890 - 1234567890 - 1234567890 + - 1234567890 - 1234567890 - 1234567890 - 1234567890 - 1234567890 + - 1234567890 - 1234567890 - 1234567890; + auto a = 1234567890 * 1234567890 * 1234567890 * 1234567890 * 1234567890 + * 1234567890 * 1234567890 * 1234567890 * 1234567890 * 1234567890 + * 1234567890 * 1234567890 * 1234567890 * 1234567890 * 1234567890 + * 1234567890 * 1234567890 * 1234567890; +} diff --git a/tests/knr/issue0229.d.ref b/tests/knr/issue0229.d.ref new file mode 100644 index 0000000..bf8a8dc --- /dev/null +++ b/tests/knr/issue0229.d.ref @@ -0,0 +1,23 @@ +enum { + SQL_CA2_READ_ONLY_CONCURRENCY = 0x00000001L, + SQL_CA2_LOCK_CONCURRENCY = 0x00000002L, + SQL_CA2_OPT_ROWVER_CONCURRENCY = 0x00000004L, + SQL_CA2_OPT_VALUES_CONCURRENCY = 0x00000008L, + SQL_CA2_SENSITIVITY_ADDITIONS = 0x00000010L, + SQL_CA2_SENSITIVITY_DELETIONS = 0x00000020L, + SQL_CA2_SENSITIVITY_UPDATES = 0x00000040L, + // * semantics of SQL_ATTR_MAX_ROWS * + SQL_CA2_MAX_ROWS_SELECT = 0x00000080L, + SQL_CA2_MAX_ROWS_INSERT = 0x00000100L, + SQL_CA2_MAX_ROWS_DELETE = 0x00000200L, + SQL_CA2_MAX_ROWS_UPDATE = 0x00000400L, + SQL_CA2_MAX_ROWS_CATALOG = 0x00000800L, + SQL_CA2_MAX_ROWS_AFFECTS_ALL = ( + SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE + | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG), + SQL_CA2_CRC_EXACT = 0x00001000L, + SQL_CA2_CRC_APPROXIMATE = 0x00002000L, + SQL_CA2_SIMULATE_NON_UNIQUE = 0x00004000L, + SQL_CA2_SIMULATE_TRY_UNIQUE = 0x00008000L, + SQL_CA2_SIMULATE_UNIQUE = 0x00010000L +} diff --git a/tests/knr/issue0237.d.ref b/tests/knr/issue0237.d.ref new file mode 100644 index 0000000..3d5f77d --- /dev/null +++ b/tests/knr/issue0237.d.ref @@ -0,0 +1,39 @@ +void fn() +{ + { + { + { + auto file = { + "integrationtest/feed/etc/config.iniaasdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "etc/config.ini" + }; + { + int x; + } + } + } + } +} + +struct A { + int x, y, z; +} + +int main() +{ + int fun() + { + import std.stdio : writeln; + import std.typecons : tuple; + + A a = { + tuple(Variant(1))[0].get!int, tuple(Variant(2))[0].get!int, + tuple(Variant(3))[0].get!int + }; + A b = { + tuple(Variant(1))[0].get!int, tuple(Variant(2))[0].get!int, + tuple(Variant(3))[0].get!int + }; + writeln(a); + } +} diff --git a/tests/knr/issue0241.d.ref b/tests/knr/issue0241.d.ref new file mode 100644 index 0000000..d7576cb --- /dev/null +++ b/tests/knr/issue0241.d.ref @@ -0,0 +1,3 @@ +void round() +body { +} diff --git a/tests/knr/issue0244.d.ref b/tests/knr/issue0244.d.ref new file mode 100644 index 0000000..cbb172d --- /dev/null +++ b/tests/knr/issue0244.d.ref @@ -0,0 +1,4 @@ +enum Status : bool { + abort = true, + ignore = false +} diff --git a/tests/knr/issue0246.d.ref b/tests/knr/issue0246.d.ref new file mode 100644 index 0000000..3637e2f --- /dev/null +++ b/tests/knr/issue0246.d.ref @@ -0,0 +1,17 @@ +unittest { + with (Object) { + // do something + } + with (Object) with (Object) { + // do something + } + with (Object) with (Object) with (Object) { + // do something + } + + with (Object) { + with (Object) { + // do something + } + } +} diff --git a/tests/knr/issue0248.d.ref b/tests/knr/issue0248.d.ref new file mode 100644 index 0000000..457d138 --- /dev/null +++ b/tests/knr/issue0248.d.ref @@ -0,0 +1,11 @@ +T[] arrayOp(T, Args...)(T res, Filter!(isType, Args) args) @trusted @nogc pure @things + if (Args[$ - 1] != "=") +{ + +} + +T[] arrayOp(T, Args...)(T res, Filter!(isType, Args) args) @trusted @nogc pure nothrow + if (Args[$ - 1] != "=") +{ + +} diff --git a/tests/knr/issue0251.d.ref b/tests/knr/issue0251.d.ref new file mode 100644 index 0000000..92cca93 --- /dev/null +++ b/tests/knr/issue0251.d.ref @@ -0,0 +1,8 @@ +void stuff() +{ + asm { + int 80; + int 0b10; + int 0x80; + } +} diff --git a/tests/knr/issue0256.d.ref b/tests/knr/issue0256.d.ref new file mode 100644 index 0000000..5776aec --- /dev/null +++ b/tests/knr/issue0256.d.ref @@ -0,0 +1,11 @@ +void main() +{ + S s1 = {a: 3}; + S s2 = {a: 3, b: "test string"}; + S s3 = {a: 3, b: "test string", c: {x: 3.14, y: 3 + 4}}; + T t = { + someStructMember1: 2, someStructMember2: 42, someStructMember3: null, // foobar + someOtherMember1: objA, someOtherMember2: objB, someOtherMember3: 0, + somethingMore: null, someFlagInThisStruct: -1 + }; +} diff --git a/tests/knr/issue0267.d.ref b/tests/knr/issue0267.d.ref new file mode 100644 index 0000000..24784cf --- /dev/null +++ b/tests/knr/issue0267.d.ref @@ -0,0 +1,19 @@ +void main() +{ + debug foo(); + else bar(); + + debug (0) + foo(); + else + bar(); + + // inlineElse reset check + + debug foo(); + + if (true) + foo(); + else + bar(); +} diff --git a/tests/knr/issue0273.d.ref b/tests/knr/issue0273.d.ref new file mode 100644 index 0000000..23afad9 --- /dev/null +++ b/tests/knr/issue0273.d.ref @@ -0,0 +1,4 @@ +void main() +{ + writeln("Expected " ~ descStr(type, data) ~ " but got " ~ this.descStr); +} diff --git a/tests/knr/issue0286.d.ref b/tests/knr/issue0286.d.ref new file mode 100644 index 0000000..b5b6ec2 --- /dev/null +++ b/tests/knr/issue0286.d.ref @@ -0,0 +1,14 @@ +void foo() +{ + if (true) + enum vectorizeable = aLongExpressionThatCausesWrapping() + && aLongExpressionThatCausesWrapping(); + else + enum vectorizeable = false; + + if (true) { + enum vectorizeable = aLongExpressionThatCausesWrapping() + && aLongExpressionThatCausesWrapping(); + } else + enum vectorizeable = false; +} diff --git a/tests/knr/issue0287.d.ref b/tests/knr/issue0287.d.ref new file mode 100644 index 0000000..9966542 --- /dev/null +++ b/tests/knr/issue0287.d.ref @@ -0,0 +1,3 @@ +alias foo = typeof({ import std.math; }); +alias bar = typeof({ write("aaa"); }); +alias baz = typeof({}); diff --git a/tests/knr/issue0303.d.ref b/tests/knr/issue0303.d.ref new file mode 100644 index 0000000..4f11f69 --- /dev/null +++ b/tests/knr/issue0303.d.ref @@ -0,0 +1,10 @@ +static foreach (thing; things) { + pragma(msg, thing); +} +static foreach_reverse (thing; things) { + pragma(msg, thing); +} +static foreach (thing; things) + pragma(msg, thing); +static foreach_reverse (thing; things) + pragma(msg, thing); diff --git a/tests/knr/issue0313.d.ref b/tests/knr/issue0313.d.ref new file mode 100644 index 0000000..bd3a545 --- /dev/null +++ b/tests/knr/issue0313.d.ref @@ -0,0 +1,13 @@ +void main() +{ + foreach (v; a) + try { + foo(); + } catch (Exception e) { + bar(); + } catch (Exception e) { + bar(); + } finally { + } + stuff(); +} diff --git a/tests/knr/issue0314.d.ref b/tests/knr/issue0314.d.ref new file mode 100644 index 0000000..c7e3541 --- /dev/null +++ b/tests/knr/issue0314.d.ref @@ -0,0 +1,10 @@ +void main() +{ + auto d = { + if (a) + foreach (b; c) { + } + else + e(); + }; +} diff --git a/tests/knr/issue0321.d.ref b/tests/knr/issue0321.d.ref new file mode 100644 index 0000000..7f891fd --- /dev/null +++ b/tests/knr/issue0321.d.ref @@ -0,0 +1,7 @@ +void test() +{ + #line 100 + int a; + #line 200 "anotherfile" + int b; +} diff --git a/tests/knr/issue0326.d.ref b/tests/knr/issue0326.d.ref new file mode 100644 index 0000000..0a51d21 --- /dev/null +++ b/tests/knr/issue0326.d.ref @@ -0,0 +1,4 @@ +void main() +{ + () @trusted { stderr.writeln("\033[01;33m", url, "\033[0m"); }(); +} diff --git a/tests/knr/issue0345.d.ref b/tests/knr/issue0345.d.ref new file mode 100644 index 0000000..5253831 --- /dev/null +++ b/tests/knr/issue0345.d.ref @@ -0,0 +1,3 @@ +class Bar(A) : Foo +if (isFloating!A) { +} diff --git a/tests/knr/issue0349.d.ref b/tests/knr/issue0349.d.ref new file mode 100644 index 0000000..c64f3e8 --- /dev/null +++ b/tests/knr/issue0349.d.ref @@ -0,0 +1,6 @@ +import super_long_import_module_name : withSuperLongSymbolNames, andAlsoLotsOfThem; +import super_long_import_module_name : withSuperLongSymbolNames, + andAlsoLotsOfThem, lotsAnsLots, andLots, andLotsOfThem, lineExceeds120; + +private: +void foo(); diff --git a/tests/knr/issue0361.d.ref b/tests/knr/issue0361.d.ref new file mode 100644 index 0000000..7e2b562 --- /dev/null +++ b/tests/knr/issue0361.d.ref @@ -0,0 +1,11 @@ +void foo() /**/ +in { +} +body { +} + +void bar() /**/ +out { +} +body { +} diff --git a/tests/knr/issue0372.d.ref b/tests/knr/issue0372.d.ref new file mode 100644 index 0000000..e47a83c --- /dev/null +++ b/tests/knr/issue0372.d.ref @@ -0,0 +1,22 @@ +void main(string[] args) +{ + // Test with catch + if (args.length > 1) + try + doSomeStuff(); + catch (Exception error) + ohNoSomeErrorHappened(); + else + thatsNotHowYouUseThisProgram(); + + // Test with finally + if (args.length > 2) + try + doOtherStuff(); + catch (Exception error) + ohNoSomeErrorHappened(); + finally + doSomeCleanup(); + else + dontDoOtherStuff(); +} diff --git a/tests/knr/issue0384.d.ref b/tests/knr/issue0384.d.ref new file mode 100644 index 0000000..cccd08b --- /dev/null +++ b/tests/knr/issue0384.d.ref @@ -0,0 +1,30 @@ +import std.stdio : readln, /* comment1 */ writeln; +import std.stdio : readln, // comment2 + writeln; +import std.stdio : readln, + // comment3 + writeln; +import std.stdio : readln, + /* comment4 */ + writeln; +import std.stdio : readln, readln, readln, readln, readln, readln, readln, + readln, readln, readln, readln, + // comment5 + writeln; +import std.stdio : // comment6 + readln, readln, readln, readln, readln, readln, // comment7 + // comment8 + writeln; +import std.stdio : /* comment9 */ + readln, readln, readln, readln, readln, readln, /* comment10 */ + // comment11 + writeln; +import std.stdio : readln, // comment12 + readln, readln, readln, readln, readln, readln, // comment13 + // comment14 + writeln; +import std.stdio : readln, + // comment15 + readln, readln, readln, readln, readln, readln, // comment16 + // comment17 + writeln; diff --git a/tests/knr/issue0426.d.ref b/tests/knr/issue0426.d.ref new file mode 100644 index 0000000..72d3d26 --- /dev/null +++ b/tests/knr/issue0426.d.ref @@ -0,0 +1,6 @@ +import std.stdio; + +@safe extern (C) void main() +{ + writeln("Hello World!"); +} diff --git a/tests/knr/issue0430.d.ref b/tests/knr/issue0430.d.ref new file mode 100644 index 0000000..1dd228b --- /dev/null +++ b/tests/knr/issue0430.d.ref @@ -0,0 +1,5 @@ +void f(bool body) +{ + if (body) { + } +} diff --git a/tests/knr/issue0433.d.ref b/tests/knr/issue0433.d.ref new file mode 100644 index 0000000..bde6071 --- /dev/null +++ b/tests/knr/issue0433.d.ref @@ -0,0 +1,7 @@ +int abs(int x) +{ + if (x < 0) // x negative, must negate + return -x; + else // x already non-negative, just return it + return x; +} diff --git a/tests/knr/issue0436.d.ref b/tests/knr/issue0436.d.ref new file mode 100644 index 0000000..fac85b5 --- /dev/null +++ b/tests/knr/issue0436.d.ref @@ -0,0 +1 @@ +extern (Objective-C) int a; diff --git a/tests/knr/issue0448.d.ref b/tests/knr/issue0448.d.ref new file mode 100644 index 0000000..d3392c2 --- /dev/null +++ b/tests/knr/issue0448.d.ref @@ -0,0 +1,3 @@ +struct S { + invariant (true); +} diff --git a/tests/knr/issue0452.d.ref b/tests/knr/issue0452.d.ref new file mode 100644 index 0000000..e4aed14 --- /dev/null +++ b/tests/knr/issue0452.d.ref @@ -0,0 +1,2 @@ +@nogc // +void foo(); diff --git a/tests/knr/issue0454.d.ref b/tests/knr/issue0454.d.ref new file mode 100644 index 0000000..27b0ef1 --- /dev/null +++ b/tests/knr/issue0454.d.ref @@ -0,0 +1,10 @@ +void main() +{ + format!"%s" // + (""); + format!("%s") // + (""); + format!("%s") // + ("", argument1, argument2, argument3, argument4, argument5, + argument6, argument7, argument8, argument9, argument10); +} diff --git a/tests/knr/issue0465.d.ref b/tests/knr/issue0465.d.ref new file mode 100644 index 0000000..b28f284 --- /dev/null +++ b/tests/knr/issue0465.d.ref @@ -0,0 +1,8 @@ +bool asdf(const string owner, const string mail) @safe +{ + requestHTTP(url, (scope HTTPClientRequest request) { + request.writeFormBody([owner: owner, mail: mail]); + }, (scope HTTPClientResponse response) {}); + + return true; +} diff --git a/tests/knr/issue0476.d.ref b/tests/knr/issue0476.d.ref new file mode 100644 index 0000000..c95e2de --- /dev/null +++ b/tests/knr/issue0476.d.ref @@ -0,0 +1,7 @@ +string BuildForwardCall() +{ + return `static if (is(typeof(mocked___.` ~ methodString ~ argsPassed ~ `))) + { + return (mocked___.` ~ methodString ~ argsPassed ~ `); + }`; +} diff --git a/tests/knr/issue0483.d.ref b/tests/knr/issue0483.d.ref new file mode 100644 index 0000000..7e3f860 --- /dev/null +++ b/tests/knr/issue0483.d.ref @@ -0,0 +1,14 @@ +module tests.issue0483; + +void main() +{ + switch (0) { + case 1: + case 2: + label: + case 3: + break; + default: + break; + } +} diff --git a/tests/knr/issue0485.d.ref b/tests/knr/issue0485.d.ref new file mode 100644 index 0000000..037932e --- /dev/null +++ b/tests/knr/issue0485.d.ref @@ -0,0 +1,5 @@ +void main() +{ + int a; + int[int] hashmap = [a : a, a : a, a : a]; +} diff --git a/tests/knr/issue0486.d.ref b/tests/knr/issue0486.d.ref new file mode 100644 index 0000000..de7a540 --- /dev/null +++ b/tests/knr/issue0486.d.ref @@ -0,0 +1,5 @@ +void main() +{ + auto someAutoVariableName = this.firstLink.secondLink + .filter!(shouldBeProbablySomeIdentifierOrNot); +} diff --git a/tests/knr/issue0497.d.ref b/tests/knr/issue0497.d.ref new file mode 100644 index 0000000..eec042e --- /dev/null +++ b/tests/knr/issue0497.d.ref @@ -0,0 +1,5 @@ +alias f1 = S function(); +alias f2 = S!"foo" function(); +alias f3 = S!5 function(); +alias f4 = S!S function(); +alias f5 = S!(S) function(); diff --git a/tests/knr/issue0501.d.ref b/tests/knr/issue0501.d.ref new file mode 100644 index 0000000..8f1cf11 --- /dev/null +++ b/tests/knr/issue0501.d.ref @@ -0,0 +1,4 @@ +void main() +{ + auto aa = ["aaa": 1, "bbb": 2]; +} diff --git a/tests/knr/issue0504.d.ref b/tests/knr/issue0504.d.ref new file mode 100644 index 0000000..7fb4598 --- /dev/null +++ b/tests/knr/issue0504.d.ref @@ -0,0 +1,40 @@ +deprecated("foo") +void test() +{ +} + +package(foo) +void bar() +{ +} + +@uda() +void baz() +{ +} + +deprecated +deprecated_() +{ +} + +@uda +void uda_() +{ +} + +@property +void property() +{ +} + +deprecated("Reason") @uda +void propertyuda() +{ +} + +deprecated("Reason") +@uda +void udaproperty() +{ +} diff --git a/tests/knr/issue0508.d.ref b/tests/knr/issue0508.d.ref new file mode 100644 index 0000000..acd5850 --- /dev/null +++ b/tests/knr/issue0508.d.ref @@ -0,0 +1,5 @@ +struct S { + @safe invariant { + assert(true); + } +} diff --git a/tests/knr/issue0509.d.ref b/tests/knr/issue0509.d.ref new file mode 100644 index 0000000..52b1c7c --- /dev/null +++ b/tests/knr/issue0509.d.ref @@ -0,0 +1,34 @@ +void main() +{ + string a = "foo" + ~ "bar" // bar + ~ "baz"; +} + +void foo() +{ + afdsafds + .asdf // blah + .flub; +} + +void main() +{ + string a = "foo" + ~ "bar" /* bar */ + ~ "baz"; +} + +void foo() +{ + afdsafds + .asdf /* blah */ + .flub; +} + +void foo() // hello +{ // world + // ok + writeln("hi"); // hi! +} // done +//finish diff --git a/tests/knr/issue0515.d.ref b/tests/knr/issue0515.d.ref new file mode 100644 index 0000000..21d91a4 --- /dev/null +++ b/tests/knr/issue0515.d.ref @@ -0,0 +1,6 @@ +struct S { + ref S foo() return + { + return this; + } +} diff --git a/tests/knr/issue0521.d.ref b/tests/knr/issue0521.d.ref new file mode 100644 index 0000000..1bf0602 --- /dev/null +++ b/tests/knr/issue0521.d.ref @@ -0,0 +1,16 @@ +public int f() return +in (true) +{ + return 0; +} + +public int g() return +out (; true) +{ + return 0; +} + +public int h() return +body { + return 0; +} diff --git a/tests/knr/keep_line_breaks.d.ref b/tests/knr/keep_line_breaks.d.ref new file mode 100644 index 0000000..977d797 --- /dev/null +++ b/tests/knr/keep_line_breaks.d.ref @@ -0,0 +1,35 @@ +@safe nothrow +@Read +@NonNull +public +int[] func(int argument_1_1, int argument_1_2, + int argument_2_1, int argument_2_2, + int argument_3_1, int argument_3_2) +{ + if (true && true + && true && true + && true && true) { + } else if (true && true && + true && true && + true && true) { + } + + func(argument_1_1).func(argument_1_2) + .func(argument_2_1) + .func(argument_2_2); + + auto x = func(argument_1_1, argument_1_2, + this.argument_2_1, this.argument_2_2, + argument_3_1, argument_3_2); + + ` + + + `.format!"%s"; + + return [ + 3, 5, + 5, 7, + 11, 13, + ]; +} diff --git a/tests/knr/lambda_param_attrib.d.ref b/tests/knr/lambda_param_attrib.d.ref new file mode 100644 index 0000000..a1feb0b --- /dev/null +++ b/tests/knr/lambda_param_attrib.d.ref @@ -0,0 +1 @@ +alias fun = (@(0) @(1) int p) => ((@Foo p) { return 0; })(p); diff --git a/tests/knr/longParamList.d.ref b/tests/knr/longParamList.d.ref new file mode 100644 index 0000000..76a508a --- /dev/null +++ b/tests/knr/longParamList.d.ref @@ -0,0 +1,17 @@ +version (AArch64) { + class SomeLongClassName { + public: + + double javaStyleFunctionName(double alpha, double bravo, double charlie, + double delta, double echo, double foxtrot, double golf, double hotel) + { + if (alpha < beta && alpha > golf && hotel < alpha && bravo >= charlie && echo < delta) { + if (alpha < beta && alpha > golf && hotel < alpha && bravo >= charlie && echo < delta) { + if (alpha < beta && alpha > golf && hotel < alpha + && bravo >= charlie && echo < delta) { + } + } + } + } + } +} diff --git a/tests/knr/minimizeLength.d.ref b/tests/knr/minimizeLength.d.ref new file mode 100644 index 0000000..efd8252 --- /dev/null +++ b/tests/knr/minimizeLength.d.ref @@ -0,0 +1,19 @@ +unittest { + validMoves!(typeof(open))(open, tokens[0 .. tokensEnd], depths[0 .. tokensEnd], + current.breaks, config, currentLineLength, indentLevel); +} + +/+ +// good +unittest +{ + validMoves!(typeof(open))(open, tokens[0 .. tokensEnd], depths[0 .. tokensEnd], + current.breaks, config, currentLineLength, indentLevel); +} +// bad +unittest +{ + validMoves!(typeof(open))(open, tokens[0 .. tokensEnd], + depths[0 .. tokensEnd], current.breaks, config, currentLineLength, indentLevel); +} ++/ diff --git a/tests/knr/multiline_string.d.ref b/tests/knr/multiline_string.d.ref new file mode 100644 index 0000000..1aba27c --- /dev/null +++ b/tests/knr/multiline_string.d.ref @@ -0,0 +1,11 @@ +unittest { + someFunctionCall(` + multi-line string + multi-line string + multi-line string + multi-line string + multi-line string + multi-line string + multi-line string + `, paramater); +} diff --git a/tests/knr/parenIndent.d.ref b/tests/knr/parenIndent.d.ref new file mode 100644 index 0000000..053585f --- /dev/null +++ b/tests/knr/parenIndent.d.ref @@ -0,0 +1,31 @@ +unittest { + if (a) { + while (sBraceDepth == 0 && indents.topIsTemp() + && ((indents.top != tok!"if" && indents.top != tok!"version") + || !peekIs(tok!"else"))) { + a(); + } + } + + if (parenDepth == 0 && (peekIs(tok!"is") || peekIs(tok!"in") + || peekIs(tok!"out") || peekIs(tok!"body"))) + writeToken(); + + { + { + while (sBraceDepth == 0 && indents.topIsTemp() + && ((indents.top != tok!"if" + && indents.top != tok!"version") || !peekIs(tok!"else"))) { + indents.pop(); + } + } + } + + { + while (sBraceDepth == 0 && indents.topIsTemp() + && ((indents.top != tok!"if" && indents.top != tok!"version") + || !peekIs(tok!"else"))) { + indents.pop(); + } + } +} diff --git a/tests/knr/propertySpacing.d.ref b/tests/knr/propertySpacing.d.ref new file mode 100644 index 0000000..0dc8bcb --- /dev/null +++ b/tests/knr/propertySpacing.d.ref @@ -0,0 +1 @@ +@property double y(); diff --git a/tests/knr/swap.d.ref b/tests/knr/swap.d.ref new file mode 100644 index 0000000..660e05a --- /dev/null +++ b/tests/knr/swap.d.ref @@ -0,0 +1,26 @@ +import std.algorithm : swap; // from Phobos standard library + +// The D solution uses templates and it's similar to the C++ one: +void mySwap(T)(ref T left, ref T right) +{ + auto temp = left; + left = right; + right = temp; +} + +void main() +{ + import std.stdio; + + int[] a = [10, 20]; + writeln(a); + + // The std.algorithm standard library module + // contains a generic swap: + swap(a[0], a[1]); + writeln(a); + + // Using mySwap: + mySwap(a[0], a[1]); + writeln(a); +} diff --git a/tests/knr/ufcschain.d.ref b/tests/knr/ufcschain.d.ref new file mode 100644 index 0000000..c36b1ae --- /dev/null +++ b/tests/knr/ufcschain.d.ref @@ -0,0 +1,6 @@ +void main() +{ + stuff[].map!(things => stuff.doThings) + .filter!(stuff) + .array(); +} diff --git a/tests/knr/wrapping1.d.ref b/tests/knr/wrapping1.d.ref new file mode 100644 index 0000000..b757ff8 --- /dev/null +++ b/tests/knr/wrapping1.d.ref @@ -0,0 +1,7 @@ +void main(string[] args) +{ + if (prevLocation != size_t.max) { + addErrorMessage(line, column, KEY, "Expression %s is true: already checked on line %d.".format( + expressions[prevLocation].formatted, expressions[prevLocation].line)); + } +} diff --git a/tests/test.sh b/tests/test.sh index b465658..da44e97 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -for braceStyle in allman otbs +for braceStyle in allman otbs knr do for source in *.d do