Skip to content

Commit 273c4ed

Browse files
committed
update poor test expectations that assume stringsAsFactors defaults to TRUE
1 parent 9e427fc commit 273c4ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/testthat/test-cookbook-lines.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ test_that("4 error bars", {
119119
info <- expect_traces(bp.err4, 4, "bar-dodge-color-err4")
120120
})
121121

122-
df <- read.table(header = T, text = "
122+
df <- read.table(header = TRUE, text = "
123123
cond xval yval
124124
control 11.5 10.8
125125
control 9.3 12.9
@@ -189,7 +189,7 @@ test_that("geom_hline -> 2 more traces", {
189189
expect_equivalent(sum(has.name), 2)
190190
})
191191

192-
df.vlines <- data.frame(cond = levels(df$cond), xval = c(10,11.5))
192+
df.vlines <- data.frame(cond = unique(df$cond), xval = c(10,11.5))
193193
# cond xval
194194
# control 10.0
195195
# treatment 11.5

tests/testthat/test-ggplot-path.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ test_that("paths with different colors become different traces", {
3939
})
4040

4141
four.paths <- rbind(
42-
data.frame(two.paths, g = "positive"),
43-
data.frame(-two.paths, g = "negative")
42+
data.frame(two.paths, g = "positive", stringsAsFactors = TRUE),
43+
data.frame(-two.paths, g = "negative", stringsAsFactors = TRUE)
4444
)
4545

4646
test_that("paths with the same color but different groups stay together", {

0 commit comments

Comments
 (0)