@@ -70,7 +70,7 @@ testthat::test_that("eval_code works with quoted code block", {
7070
7171 testthat :: expect_equal(
7272 q1 @ code ,
73- " a <- 1\n b <- 2"
73+ c( " a <- 1" , " b <- 2" )
7474 )
7575 testthat :: expect_equal(q1 @ env , list2env(list (a = 1 , b = 2 )))
7676})
@@ -88,7 +88,7 @@ testthat::test_that("an error when calling eval_code returns a qenv.error object
8888 unname(q $ trace ),
8989 c(" x <- 1" , " y <- 2" , " z <- w * x" )
9090 )
91- testthat :: expect_equal(q $ message , " object 'w' not found \n when evaluating qenv code:\n z <- w * x" )
91+ testthat :: expect_equal(q $ message , " object 'w' not found \n when evaluating qenv code:\n expression(z <- w * x) " )
9292})
9393
9494testthat :: test_that(" a warning when calling eval_code returns a qenv object which has warnings" , {
@@ -97,13 +97,13 @@ testthat::test_that("a warning when calling eval_code returns a qenv object whic
9797 testthat :: expect_s4_class(q , " qenv" )
9898 testthat :: expect_equal(
9999 q @ warnings ,
100- c(" " , paste(rep( " > \" ff\" is not a graphical parameter\n " , 4 ), collapse = " " ) )
100+ c(" " , " > \" ff\" is not a graphical parameter\n " )
101101 )
102102})
103103
104104testthat :: test_that(" eval_code with a vector of code produces one warning element per code element" , {
105105 q <- eval_code(qenv(), c(" x <- 1" , " y <- 1" , " warning('warn1')" ))
106- testthat :: expect_equal(c(" > warn1\n " ), q @ warnings )
106+ testthat :: expect_equal(c(" " , " " , " > warn1\n " ), q @ warnings )
107107})
108108
109109
0 commit comments