Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 23, 2024
1 parent db670ec commit abc0469
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 28 deletions.
1 change: 0 additions & 1 deletion inst/tinytest/_tinysnapshot/escape_label_title.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\begin{table}
\centering
\caption{Blah\_blah \label{tab:blah-blah}}
\centering
\begin{tabular}[t]{lc}
\toprule
& (1)\\
Expand Down
38 changes: 19 additions & 19 deletions inst/tinytest/_tinysnapshot/rbind-add_rows_rbind.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@


| | (1) | (2) |
|:------------|---------:|---------:|
| (Intercept) | 20.091 | -5.114 |
| | (1.065) | (10.030) |
| qsec | | 1.412 |
| | | (0.559) |
| R2 | 0.000 | 0.175 |
| Info | ??? | XYZ |
| Num.Obs. | 32 | 32 |
| RMSE | 5.93 | 5.39 |
|:------------|---------:|---------:|
| (Intercept) | 146.687 | 631.704 |
| | (12.120) | (88.700) |
| qsec | | -27.174 |
| | | (4.946) |
| R2 | 0.000 | 0.502 |
| Num.Obs. | 32 | 32 |
| RMSE | 67.48 | 47.64 |
|:------------|---------:|---------:|
| | (1) | (2) |
|:------------|--------:|--------:|
| (Intercept) | 20.09 | -5.11 |
| | (1.07) | (10.03) |
| qsec | | 1.41 |
| | | (0.56) |
| R2 | 0.000 | 0.175 |
| Info | ??? | XYZ |
| Num.Obs. | 32 | 32 |
| RMSE | 5.93 | 5.39 |
|:------------|--------:|--------:|
| (Intercept) | 146.69 | 631.70 |
| | (12.12) | (88.70) |
| qsec | | -27.17 |
| | | (4.95) |
| R2 | 0.000 | 0.502 |
| Num.Obs. | 32 | 32 |
| RMSE | 67.48 | 47.64 |
|:------------|--------:|--------:|
17 changes: 10 additions & 7 deletions inst/tinytest/test-escape.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ expect_snapshot_print(
"escape-panel_escape_TRUE")


# Issue #594: escape LaTeX label
if (!requiet("tinysnapshot")) exit_file("tinysnapshot")
using("tinysnapshot")
mod <- lm(mpg ~ hp, mtcars)
expect_snapshot_print(
modelsummary(mod, "latex", title = "Blah_blah \\label{tab:blah-blah}"),
"escape_label_title")

# Issue #560 and #693
mod <- lm(mpg ~ I(wt^2) * disp, data = mtcars)
Expand All @@ -177,3 +170,13 @@ est_comb <- feols(y ~ x1 | fe1 +fe2 +fe3, data = base, cluster= "fe1^fe2")
expect_snapshot_print(
modelsummary(est_comb, output = "latex", escape = TRUE),
"escape-hat_fixest")


exit_file("minor snapshot diff, possibly related to kableExtra version")
# Issue #594: escape LaTeX label
if (!requiet("tinysnapshot")) exit_file("tinysnapshot")
using("tinysnapshot")
mod <- lm(mpg ~ hp, mtcars)
expect_snapshot_print(
modelsummary(mod, "latex", title = "Blah_blah \\label{tab:blah-blah}"),
"escape_label_title")
3 changes: 2 additions & 1 deletion inst/tinytest/test-rbind.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ panels <- list(
expect_snapshot_print(
modelsummary(
panels,
fmt = 2, # tolerance
output = "markdown",
shape = "rbind",
gof_map = gm,
add_rows = rows),
"rbind-add_rows_rbind"
)
)

0 comments on commit abc0469

Please sign in to comment.