@@ -6,10 +6,7 @@ testthat::test_that("Concatenate two identical qenvs outputs", {
66 q12 <- concat(q1 , q2 )
77
88 testthat :: expect_equal(q12 @ .xData , q1 @ .xData )
9- testthat :: expect_identical(
10- unlist(q12 @ code ),
11- c(" iris1 <- iris" , " iris1 <- iris" )
12- )
9+ testthat :: expect_identical(get_code(q12 ), " iris1 <- iris\n iris1 <- iris" )
1310})
1411
1512testthat :: test_that(" Concatenate two independent qenvs results in object having combined code and environments" , {
@@ -22,13 +19,8 @@ testthat::test_that("Concatenate two independent qenvs results in object having
2219 q12 <- concat(q1 , q2 )
2320
2421 testthat :: expect_equal(q12 @ .xData , list2env(list (iris1 = iris , mtcars1 = mtcars )))
25- testthat :: expect_identical(
26- unlist(q12 @ code ),
27- c(" iris1 <- iris" , " mtcars1 <- mtcars" )
28- )
29- q12_ids <- unlist(lapply(q12 @ code , " attr" , " id" ))
30- q1_q2_ids <- c(attr(q1 @ code [[1 ]], " id" ), attr(q2 @ code [[1 ]], " id" ))
31- testthat :: expect_identical(q12_ids , q1_q2_ids )
22+ testthat :: expect_identical(get_code(q12 ), " iris1 <- iris\n mtcars1 <- mtcars" )
23+ testthat :: expect_identical(names(q12 @ code ), c(names(q1 @ code ), names(q2 @ code )))
3224})
3325
3426testthat :: test_that(" Concatenate qenvs results with the same variable, the RHS has priority" , {
@@ -59,7 +51,7 @@ testthat::test_that("Concatenate two independent qenvs with warnings results in
5951 q12 <- concat(q1 , q2 )
6052
6153 testthat :: expect_equal(
62- unlist(lapply(q12 @ code , attr , " warning" )),
54+ unlist(lapply(q12 @ code , attr , " warning" ), use.names = FALSE ),
6355 c(
6456 " > This is warning 1\n " ,
6557 " > This is warning 2\n "
@@ -74,7 +66,7 @@ testthat::test_that("Concatenate two independent qenvs with messages results in
7466 q12 <- concat(q1 , q2 )
7567
7668 testthat :: expect_equal(
77- unlist(lapply(q12 @ code , attr , " message" )),
69+ unlist(lapply(q12 @ code , attr , " message" ), use.names = FALSE ),
7870 c(
7971 " > This is message 1\n " ,
8072 " > This is message 2\n "
0 commit comments