Skip to content

Commit 2437639

Browse files
committed
extra test for sqrt- and log- terms
1 parent 2cd286a commit 2437639

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/testthat/test-standardize_models.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,4 +432,28 @@ test_that("fixest", {
432432
unname(manual_stand$coefficients)
433433
)
434434
expect_identical(unname(auto_stand$se), unname(manual_stand$se))
435+
436+
### Inform the user if some terms are log() or sqrt()
437+
orig <- fixest::feols(
438+
drat ~ log(mpg) | cyl + am,
439+
data = mtcars
440+
)
441+
# TODO: same as above
442+
expect_message(
443+
suppressWarnings({
444+
auto_stand <- standardize(orig)
445+
}),
446+
"Formula contains log- or sqrt-terms"
447+
)
448+
orig <- fixest::feols(
449+
drat ~ sqrt(mpg) | cyl + am,
450+
data = mtcars
451+
)
452+
# TODO: same as above
453+
expect_message(
454+
suppressWarnings({
455+
auto_stand <- standardize(orig)
456+
}),
457+
"Formula contains log- or sqrt-terms"
458+
)
435459
})

0 commit comments

Comments
 (0)