We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ea0de9 commit c1e275dCopy full SHA for c1e275d
tests/testthat/test-base-model.R
@@ -158,3 +158,34 @@ test_that("strict args order", {
158
# Assert
159
expect_equal(res, list(a = 4L, b = 2L))
160
})
161
+
162
+# ---
163
+test_that("discard extra fields", {
164
+ # # Prepare
165
+ my_model <- base_model(
166
+ cyl = is.double,
167
+ mpg = is.double
168
+ )
169
170
+ # Act
171
+ res <- my_model(mtcars)
172
173
+ # Assert
174
+ expect_equal(ncol(res), 2)
175
+})
176
177
178
+test_that("allow extra fields", {
179
180
181
182
+ mpg = is.double,
183
+ .model_config = model_config(extra = "allow")
184
185
186
187
188
189
190
+ expect_equal(ncol(res), 11)
191
0 commit comments