dfmt/tests/otbs
Daniel Zuncke be24f122dd
Fix issue #432
Overview:
Array astInformation.structInitEndLocations is used to find index to use
in astInformation.indentInfoSortedByEndLocation.
Both are sorted, first is used to find the array index, second is
accessed at that index to get brace indentation information.

Problem:
structInitEndLocations is generated from struct initializers
exclusively while the brace information array also contains entries
for function literal initializers. Thus when function literal init(s)
are used, we get accumulating off by one errors in the second array:

match value in structInitEndLocations and take that index:
[3, 50]
    ^--> index 1

take brace indent information from that index:
[3, 15, 50]
    |   ^--> the one we want
    ^------> the one we get (function literal init)

Solution:
This guarantees that searching forward works.
While better search strategies than linear are possible, this should be
enough for any sane and most of the insane code files.
2023-10-17 03:49:31 +02:00
..
.d.ref Fix #31 2015-04-20 00:07:33 -07:00
2d_arrays.d.ref fix otbs expected test result for 2d arrays 2019-01-11 22:23:04 +01:00
DeclSpacing.d.ref
argument_chain_indent.d.ref Revert operator indentation in an argument list 2023-02-06 10:17:09 +01:00
argument_chain_keep_breaks.d.ref Revert operator indentation in an argument list 2023-02-06 10:17:09 +01:00
array_access.d.ref Fix double array indentation inside parens 2021-06-12 05:39:30 +00:00
assoc_key_indent.d.ref Don't indent associative array keys as labels 2021-03-09 11:38:33 +01:00
associative_array.d.ref Fix double array indentation inside parens 2021-06-12 05:39:30 +00:00
associative_array_complex.d.ref Fix double array indentation inside parens 2021-06-12 05:39:30 +00:00
attribute_constraint.d.ref Fix #345 - Case of trailing white space 2018-10-10 13:37:06 +02:00
breakOnDots.d.ref Better formatting for UFCS chains 2018-05-09 16:06:12 +02:00
catchExceptionNested.d.ref Fix #313, and implement a better fix for #314 2018-02-02 04:48:57 -08:00
comments.d.ref Fix indentation of callchains with comments 2022-08-06 08:55:43 +02:00
constraint_singe_tab.d.ref fix #236 - Allow constraints to be indented by a single tab (#337) 2018-03-02 16:26:54 +01:00
constraint_singe_tab2.d.ref fix #236 - Allow constraints to be indented by a single tab (#337) 2018-03-02 16:26:54 +01:00
contracts.d.ref
debug-inside-if.d.ref Properly recognize debug as block header 2018-10-11 05:43:18 +02:00
debug_with_param.d.ref Fix else indentation after debug conditions 2018-10-09 13:19:07 +02:00
dip1009.d.ref Put a space in contract expressions 2020-01-05 20:28:56 +01:00
do_body.d.ref Handle do as contract header and handle body as identifier (#360) 2018-06-14 23:29:47 +02:00
empty.d.ref Add empty test files 2018-03-08 11:57:07 +01:00
enum_attribs.d.ref Properly format enum member attributes and parameter attributes 2018-09-29 22:52:49 +02:00
foreach_array.d.ref Fix array literal indentation in foreach (#554) 2022-06-14 12:35:54 +00:00
frontpage.d.ref
func_param_attrib.d.ref Properly format enum member attributes and parameter attributes 2018-09-29 22:52:49 +02:00
guessnumber.d.ref Fix #313, and implement a better fix for #314 2018-02-02 04:48:57 -08:00
hello.d.ref
higherorder.d.ref
incomplete_alias.d.ref add some missing hasCurrent checks 2023-03-01 22:07:37 +01:00
issue0017.d.ref Fix 2D (assoc) arrays & add tests 2019-01-11 22:06:57 +01:00
issue0018.d.ref
issue0021.d.ref
issue0022.d.ref
issue0023.d.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
issue0023.d.ref Fix 2D (assoc) arrays & add tests 2019-01-11 22:06:57 +01:00
issue0024.d.ref
issue0025.d.ref
issue0026.d.ref
issue0027.d.ref Fix #140 2015-04-27 15:34:35 -07:00
issue0028.d.ref
issue0029.d.ref
issue0030.d.ref
issue0031.d.ref Fix #31 2015-04-20 00:07:33 -07:00
issue0032.d.ref
issue0033.d.ref
issue0034.d.ref
issue0035.d.ref Fix #35 2015-04-20 00:56:24 -07:00
issue0037.d.ref
issue0038.d.ref
issue0039.d.ref
issue0041.d.ref
issue0042.d.ref
issue0043.d.ref
issue0044.d.ref
issue0045.d.ref
issue0046.d.ref
issue0047.d.ref Fix an incredibly annoying bug where line break info was being ignored when wrapping at commas 2016-01-20 03:28:31 -08:00
issue0048.d.ref
issue0049.d.ref
issue0050.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0051.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0052.d.ref
issue0053.d.ref
issue0054.d.ref Fix #140 2015-04-27 15:34:35 -07:00
issue0056.d.ref
issue0057.d.ref
issue0058.d.ref
issue0059.d.ref
issue0060.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0061.d.ref
issue0062.d.ref
issue0063.d.ref Fix #147 2015-04-28 22:26:49 -07:00
issue0064.d.ref
issue0065.d.ref
issue0066.d.ref
issue0067.d.ref
issue0068.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0069.d.ref
issue0070.d.ref
issue0073.d.ref
issue0074.d.ref Fix #216 2016-01-18 14:06:47 -08:00
issue0076.d.ref Fix #76 2015-06-04 19:20:58 -07:00
issue0079.d.ref
issue0080.d.ref
issue0081.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0082.d.ref
issue0083.d.ref
issue0085.d.ref
issue0086.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0088.d.ref
issue0089.d.ref
issue0090.d.ref
issue0091.d.ref
issue0092.d.ref
issue0093.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0094.d.ref
issue0095.d.ref
issue0096.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0097.d.ref Implement #97 2015-06-08 02:25:49 -07:00
issue0098.d.ref Fix #140 2015-04-27 15:34:35 -07:00
issue0099.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0100.d.ref
issue0101.d.ref
issue0102.d.ref Tests for #102 2015-06-04 19:23:02 -07:00
issue0106.d.ref
issue0107.d.ref
issue0108.d.ref
issue0109.d.ref
issue0111.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
issue0112.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
issue0112_variation.d.ref Add test for issue0112 without array item 2019-01-12 12:37:06 +01:00
issue0114.d.ref Fix #114 2015-03-31 15:08:44 -07:00
issue0116.d.ref
issue0117.d.ref
issue0118.d.ref Fix #118 2015-03-18 16:31:56 -07:00
issue0119.d.ref Don't put spaces inside empty braces 2018-11-06 16:40:25 +01:00
issue0120.d.ref Fix #166 2015-08-10 16:37:09 -07:00
issue0123.d.ref Indentation rework 2016-01-19 03:58:19 -08:00
issue0125.d.ref Bring back the 'dfmt off'/'dfmt on' feature that was missing from this branch for some stupid reason 2015-06-04 18:15:12 -07:00
issue0126.d.ref Fix #126 2015-04-08 18:16:50 -07:00
issue0127.d.ref Fix #127 2015-04-20 00:30:13 -07:00
issue0128.d.ref Fix #128 2015-04-16 12:14:39 -07:00
issue0130.d.ref Implement #130 2015-06-08 03:05:11 -07:00
issue0134.d.ref trivially fix #134 2019-11-25 17:09:51 +01:00
issue0136.d.ref Fix #136 2015-04-23 16:53:31 -07:00
issue0138.d.ref Fix #138 2015-04-24 13:15:53 -07:00
issue0139.d.ref Fix #139 2015-04-24 17:28:06 -07:00
issue0140.d.ref Fix #140 2015-04-27 15:34:35 -07:00
issue0142.d.ref Fix #142 2015-04-27 15:46:19 -07:00
issue0146.d.ref Fix #146 2015-04-28 22:39:47 -07:00
issue0147.d.ref Fix #147 2015-04-28 22:26:49 -07:00
issue0148.d.ref Fix #148 2015-04-29 11:39:37 -07:00
issue0150.d.ref Fix #150 2015-05-07 23:56:50 -07:00
issue0151.d.ref Fix #151 2015-05-07 23:51:15 -07:00
issue0152.d.ref Fix #152 2015-05-12 16:40:33 -07:00
issue0153.d.ref Fix #345 - Case of trailing white space 2018-10-10 13:37:06 +02:00
issue0154.d.ref Fix #154 2015-05-13 14:21:35 -07:00
issue0155.d.ref Fix #155 2015-05-13 14:43:42 -07:00
issue0156.d.ref Fix #156 2015-05-20 02:48:48 -07:00
issue0158.d.ref Update dparse 2016-04-28 15:27:57 -07:00
issue0162.d.ref Indentation rework 2016-01-19 03:58:19 -08:00
issue0166.d.ref Fix #166 2015-08-10 16:37:09 -07:00
issue0169.d.ref Fix #188 2015-09-17 03:01:29 -07:00
issue0172.d.ref #172 2015-08-24 12:44:52 -07:00
issue0174.d.ref enum can also be used in is() expressions 2015-08-21 19:13:08 +02:00
issue0177.d.ref Fix #177 2015-08-24 13:28:16 -07:00
issue0185.d.ref Fix #185 2015-09-16 17:07:39 -07:00
issue0186.d.ref Fix #223 2016-01-22 01:51:44 -08:00
issue0187.d.ref Fix #187 2015-09-16 17:20:16 -07:00
issue0189.d.ref Fix #189 2015-09-17 22:58:39 -07:00
issue0190.d.ref Fix #190 2015-10-09 14:21:30 -07:00
issue0194.d.ref Fix #194 2015-12-14 15:24:48 -08:00
issue0195.d.ref trivially fix #195 2019-11-25 17:09:51 +01:00
issue0204.d.ref Fix #204 2016-01-13 20:52:26 -08:00
issue0205.d.ref Tests for #205 2016-01-14 14:28:15 -08:00
issue0206.d.ref Fix #206 2016-01-14 14:40:16 -08:00
issue0207.d.ref Fix #207 2016-01-14 16:02:24 -08:00
issue0208.d.ref Fix #208 2016-01-15 16:29:00 -08:00
issue0209.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
issue0210.d.ref Fix #210 and run dfmt on itself 2016-01-18 15:10:39 -08:00
issue0212.d.ref Fix #212 2016-01-18 14:18:09 -08:00
issue0213.d.ref Fix #213 2016-01-18 15:32:49 -08:00
issue0215a.d.ref Fix #223 2016-01-22 01:51:44 -08:00
issue0215b.d.ref Indentation rework 2016-01-19 03:58:19 -08:00
issue0215c.d.ref Indentation rework 2016-01-19 03:58:19 -08:00
issue0215d.d.ref Fix #223 2016-01-22 01:51:44 -08:00
issue0216.d.ref Fix #216 2016-01-18 14:06:47 -08:00
issue0219.d.ref Fix #219 2016-01-22 04:53:20 -08:00
issue0220.d.ref Fix #220 2016-01-22 04:48:29 -08:00
issue0221.d.ref Fix #221 2016-01-20 17:00:46 -08:00
issue0222.d.ref Fix #222 2016-01-21 22:11:32 -08:00
issue0223.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
issue0224.d.ref Fix #224 2016-01-22 18:48:36 -08:00
issue0225.d.ref Fix #225 2016-01-22 19:06:09 -08:00
issue0226.d.ref Fix #226 2016-01-26 12:56:19 -08:00
issue0228.d.ref obey `end_of_line` setting in all tokens (#550) 2022-05-25 13:21:07 +02:00
issue0229.d.ref Fix #229 2016-02-25 14:02:12 -08:00
issue0237.d.ref Add tests 2018-03-07 21:18:25 +01:00
issue0241.d.ref Fix #241 2016-04-28 15:23:00 -07:00
issue0244.d.ref fix #244 - Wrong indentation for bool enums 2018-10-03 12:07:54 +02:00
issue0246.d.ref Fix #246 - Questionable indentation for multiple `with` statements 2018-10-07 12:36:17 +02:00
issue0248.d.ref Fix #248 2017-10-25 13:26:35 -07:00
issue0251.d.ref Fix #251 2016-06-30 17:41:13 -07:00
issue0256.d.ref Add: Test for nested struct formatting 2019-08-03 08:55:32 +09:00
issue0267.d.ref Fix #267 - Indentation with debug inconsistent 2018-10-11 05:43:18 +02:00
issue0273.d.ref Fix #273 2017-03-07 16:12:27 -08:00
issue0286.d.ref Fix #286 - Weird indentation in else branch after wrapping expression (#393) 2018-10-07 19:56:08 +02:00
issue0287.d.ref Don't put spaces inside empty braces 2018-11-06 16:40:25 +01:00
issue0303.d.ref Fix test 2017-11-27 07:37:09 +09:00
issue0313.d.ref Fix #313, and implement a better fix for #314 2018-02-02 04:48:57 -08:00
issue0314.d.ref Fix #314 2018-01-29 14:18:59 -08:00
issue0321.d.ref Fix #321 2018-02-02 00:52:30 -08:00
issue0326.d.ref Fix #326 - Spaces missing after attributes in function literals (#394) 2018-10-07 20:47:28 +02:00
issue0345.d.ref Fix #345 - Case of trailing white space 2018-10-10 13:37:06 +02:00
issue0349.d.ref Allow comments in selective imports. (#403) 2018-10-19 01:45:52 +02:00
issue0361.d.ref Fix #361 - Unexpected empty new line if function header ends with a comment 2019-05-14 09:00:56 +09:00
issue0372.d.ref Fix #372 - Improper indentation after single-line catch (#395) 2018-10-08 13:32:15 +02:00
issue0384.d.ref Allow comments in selective imports. (#403) 2018-10-19 01:45:52 +02:00
issue0426.d.ref Fix #426 2019-05-13 17:49:12 +09:00
issue0430.d.ref fix #430 already working 2019-11-25 17:09:51 +01:00
issue0432.d.ref Fix issue #432 2023-10-17 03:49:31 +02:00
issue0433.d.ref Fix #433 2019-05-13 12:13:32 +09:00
issue0436.d.ref Fix #436 2019-02-20 11:25:31 -08:00
issue0448.d.ref Put a space in contract expressions 2020-01-05 20:28:56 +01:00
issue0451.d.ref Fix comment before contract 2021-09-07 14:29:45 +02:00
issue0452.d.ref Put space between a comment and an identifier 2020-01-05 23:11:18 +01:00
issue0454.d.ref Wrap the argument list of a template function 2020-01-12 22:49:16 +01:00
issue0465.d.ref Print colon in AA before identifiers 2020-08-27 09:43:25 +02:00
issue0476.d.ref Break line on multiline strings 2020-08-10 15:25:59 +02:00
issue0483.d.ref Fix issue 483: indent continuing case statements on the same level 2020-07-22 10:27:52 +02:00
issue0485.d.ref Print colon in AA before identifiers 2020-08-27 09:43:25 +02:00
issue0486.d.ref Regenerate line break hints after newline 2020-09-04 00:14:25 +02:00
issue0494.d.ref Very long chained calls in array literals are indented weirdly 2022-07-28 17:14:01 +02:00
issue0494_else.d.ref Fix else indentation after array literal 2023-01-14 02:18:28 +01:00
issue0494_keep_line_break.d.ref Very long chained calls in array literals are indented weirdly 2022-07-28 17:14:01 +02:00
issue0497.d.ref Fix issue 497: insert space before function/delegate in function type that returns template instantiated with parenless value argument 2020-07-20 08:04:51 +02:00
issue0501.d.ref Print colon in AA before identifiers 2020-08-27 09:43:25 +02:00
issue0503.d.ref Add reflow_property_chains option 2023-03-29 11:29:59 +02:00
issue0504.d.ref Keep line break after function attributes 2020-09-02 09:09:19 +02:00
issue0508.d.ref Fix Issue 508 (#511) 2020-10-01 08:35:20 +02:00
issue0509.d.ref Don't output an extra newline after a comment 2020-10-10 07:25:27 +02:00
issue0515.d.ref Fix #515 2020-10-07 02:19:55 -07:00
issue0521.d.ref Don't write a space after the return attribute 2021-02-27 16:06:06 +01:00
issue0528.d.ref Format do like body after function attributes 2021-06-14 21:06:32 +00:00
issue0552_cr.d.ref Retain line ending by default. (#553) 2022-07-28 17:21:10 +02:00
issue0552_crlf.d.ref Retain line ending by default. (#553) 2022-07-28 17:21:10 +02:00
issue0552_lf.d.ref Retain line ending by default. (#553) 2022-07-28 17:21:10 +02:00
keep_break_in_array_arg.d.ref Keep "(" indentation with a "]" in the same line 2023-03-20 18:23:33 +01:00
keep_break_in_array_chain.d.ref Format multiline arrays first (#538) 2021-06-16 17:23:27 +03:00
keep_line_breaks.d.ref keep_line_breaks: Compare with the token end line 2020-03-24 14:39:31 +01:00
keep_single_indent.d.ref Add single_indent option 2021-05-18 06:36:57 +02:00
lambda_param_attrib.d.ref Properly format enum member attributes and parameter attributes 2018-09-29 22:52:49 +02:00
longParamList.d.ref Indentation rework 2016-01-19 03:58:19 -08:00
minimizeLength.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00
multiline_string.d.ref Fix bug with multi-line string literals 2016-02-01 00:35:26 -08:00
parenIndent.d.ref Run dfmt on itself and debug some wrapping calculations 2016-01-19 05:20:31 -08:00
propertySpacing.d.ref
single_indent.d.ref Add single_indent option 2021-05-18 06:36:57 +02:00
space_after_keywords.d.ref No space after keywords 2023-07-26 16:13:48 +02:00
swap.d.ref
ufcschain.d.ref Better formatting for UFCS chains 2018-05-09 16:06:12 +02:00
wrapping1.d.ref Improve line wrapping heuristics 2016-01-25 05:24:09 -08:00