@@ -135,8 +135,14 @@ test_that("warning lines are correct after skipping", {
135
135
136
136
expect_equal(problems(out2 )$ row , 1 )
137
137
138
- expect_warning(out3 <- read_csv(I(" v1,v2\n\n 1,2\n\n 3,4" ), col_types = " i" ))
139
- expect_warning(out4 <- read_csv(I(" v1,v2\n #foo\n 1,2\n #bar\n 3,4" ), col_types = " i" , comment = " #" ))
138
+ expect_snapshot(
139
+ out3 <- read_csv(I(" v1,v2\n\n 1,2\n\n 3,4" ), col_types = " i" ),
140
+ variant = edition_variant()
141
+ )
142
+ expect_snapshot(
143
+ out4 <- read_csv(I(" v1,v2\n #foo\n 1,2\n #bar\n 3,4" ), col_types = " i" , comment = " #" ),
144
+ variant = edition_variant()
145
+ )
140
146
141
147
expect_equal(problems(out3 )$ row , c(1 , 2 ))
142
148
@@ -158,7 +164,10 @@ test_that("extra columns generates warnings", {
158
164
159
165
test_that(" too few or extra col_types generates warnings" , {
160
166
skip_if_edition_second()
161
- expect_warning(out1 <- read_csv(I(" v1,v2\n 1,2" ), col_types = " i" , lazy = FALSE ))
167
+ expect_snapshot(
168
+ out1 <- read_csv(I(" v1,v2\n 1,2" ), col_types = " i" , lazy = FALSE ),
169
+ variant = edition_variant()
170
+ )
162
171
expect_equal(problems(out1 )$ expected , " 1 columns" )
163
172
expect_equal(problems(out1 )$ actual , " 2 columns" )
164
173
@@ -219,7 +228,10 @@ test_that("comments are ignored regardless of where they appear", {
219
228
expect_equal(out2 $ x , 1 )
220
229
expect_equal(out3 $ x , 1 )
221
230
222
- out4 <- read_csv(I(" x,y\n 1,#comment" ), comment = " #" , col_types = " cc" )
231
+ expect_snapshot(
232
+ out4 <- read_csv(I(" x,y\n 1,#comment" ), comment = " #" , col_types = " cc" ),
233
+ variant = edition_variant()
234
+ )
223
235
expect_equal(out4 $ y , NA_character_ )
224
236
225
237
expect_warning(out5 <- read_csv(I(" x1,x2,x3\n A2,B2,C2\n A3#,B2,C2\n A4,A5,A6" ), comment = " #" , lazy = FALSE ))
0 commit comments