Skip to content

Commit 17aad62

Browse files
committed
Format with air
Two single-statement loop bodies in test-loops.R are marked `# fmt: skip` rather than reformatted. Those functions are the regression tests for the single-statement-body hoist fix, and their point is that the body is *not* a `{` block; letting air brace them would leave the tests passing against the already-working braced path and silently stop covering the bug.
1 parent 6bcadbb commit 17aad62

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tests/testthat/test-loops.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ test_that("single-statement while/repeat bodies re-run their hoisted statements"
112112
#
113113
# Run-tested only via the snapshots: a regression in either would
114114
# compute the product once before the loop and never terminate.
115+
# fmt: skip
115116
squarings_while <- function(m) {
116117
declare(type(m = double(2, 2)))
117118
while (m[1, 1] < 100) m <- m %*% m
@@ -120,6 +121,7 @@ test_that("single-statement while/repeat bodies re-run their hoisted statements"
120121

121122
expect_translation_snapshots(squarings_while)
122123

124+
# fmt: skip
123125
squarings_repeat <- function(m) {
124126
declare(type(m = double(2, 2)))
125127
repeat m <- m %*% m

0 commit comments

Comments
 (0)