Skip to content

Commit a1e405f

Browse files
authored
Add a regression test for an idempotency bug. (#1752)
Idempotency bugs where the formatter produces another change if you re-run it on its own output are like Whac-a-mole. We don't have a systematic way to prevent them, so I just fix them as they come up. We do *test* for them systematically now. Every single test is formatted twice, again on the output of the first format to ensure that what we test is at least idempotent. This one appears to no longer be an issue because the test is already passing. Probably got fixed in some of the changes around comment handling. This just adds a regression test. Close #1625.
1 parent 7278eff commit a1e405f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/tall/regression/1600/1625.unit

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
>>>
2+
bool foo() {
3+
if (
4+
// Explicitly stated to not be a bot.
5+
Platform.environment['BOT'] == 'false'
6+
) {
7+
return false;
8+
}
9+
}
10+
<<<
11+
bool foo() {
12+
if (
13+
// Explicitly stated to not be a bot.
14+
Platform.environment['BOT'] == 'false') {
15+
return false;
16+
}
17+
}

0 commit comments

Comments
 (0)