Skip to content

Commit db76b97

Browse files
committed
Format with air
1 parent 365375c commit db76b97

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/testthat/_snaps/type-promotion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
Output
406406
function(x) {
407407
declare(type(x = integer(1)))
408-
x ^ -1L
408+
x^-1L
409409
}
410410
<environment: 0x0>
411411
Code

tests/testthat/test-type-promotion.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ test_that("%% and %/% with mixed modes promote", {
101101
test_that("^ always returns double; integer exponent stays exact", {
102102
fn <- function(x) {
103103
declare(type(x = integer(1)))
104-
x ^ -1L
104+
x^-1L
105105
}
106106
# locks the `** (...)` parenthesization and the double result mode:
107107
# integer ** used to return integer (R: 0.5, bug: 0) through
@@ -111,21 +111,21 @@ test_that("^ always returns double; integer exponent stays exact", {
111111

112112
fn2 <- function(x) {
113113
declare(type(x = integer(n)))
114-
x ^ 2L
114+
x^2L
115115
}
116116
expect_quick_equal(fn2, list(-3:3))
117117

118118
fn3 <- function(x) {
119119
declare(type(x = double(1)))
120-
x ^ 2L
120+
x^2L
121121
}
122122
# negative base with whole-number exponent is defined in R (and in
123123
# Fortran's real ** int, unlike real ** real)
124124
expect_quick_equal(fn3, list(-2), list(2.5))
125125

126126
fn4 <- function(x) {
127127
declare(type(x = double(1)))
128-
x ^ 2.5
128+
x^2.5
129129
}
130130
expect_quick_equal(fn4, list(2))
131131
})
@@ -155,7 +155,7 @@ test_that("logical operands participate in arithmetic as integers", {
155155

156156
fn_pow <- function(a, b) {
157157
declare(type(a = logical(1)), type(b = logical(1)))
158-
a ^ b
158+
a^b
159159
}
160160
# R: TRUE ^ TRUE is 1 (double)
161161
expect_quick_equal(fn_pow, list(TRUE, TRUE), list(FALSE, TRUE))

0 commit comments

Comments
 (0)