Skip to content

Commit 8349eef

Browse files
[skip style] [skip vbump] Restyle files
1 parent 2eab6d3 commit 8349eef

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

R/qenv-subset.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ setMethod("subset", signature = c("qenv"), function(object, names) {
4040
object@messages <- object@messages[indexes]
4141

4242
object
43-
4443
})
4544

4645
setMethod("subset", signature = c("qenv.error", "ANY"), function(object, names) {
4746
object
4847
})
49-

R/utils-get_code_dependency.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,4 +471,3 @@ extract_comments <- function(parsed_code) {
471471
get_comments
472472
))
473473
}
474-

tests/testthat/test-qenv_get_code.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,10 @@ testthat::test_that("detects occurrence of a function definition with a @linksto
586586
q <- eval_code(qenv(), code)
587587
testthat::expect_identical(
588588
get_code(q, names = "x"),
589-
c("foo <- function() {\n env <- parent.frame()\n env$x <- 0\n}",
590-
"foo() # @linksto x")
589+
c(
590+
"foo <- function() {\n env <- parent.frame()\n env$x <- 0\n}",
591+
"foo() # @linksto x"
592+
)
591593
)
592594
})
593595
# $ ---------------------------------------------------------------------------------------------------------------

tests/testthat/test-qenv_get_warnings.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ testthat::test_that("get_warnings accepts a qenv object with 2 warnings", {
2828
eval_code(bquote(warning("This is a warning 1!"))) %>%
2929
eval_code(bquote(warning("This is a warning 2!")))
3030
testthat::expect_identical(
31-
get_warnings(q), #TODO fix
31+
get_warnings(q), # TODO fix
3232
paste0(
3333
"~~~ Warnings ~~~\n\n> This is a warning 1!\nwhen running code:\nwarning(\"This is a warning 1!\")",
3434
"\n\n> This is a warning 2!\nwhen running code:\nwarning(\"This is a warning 2!\")\n\n",
@@ -42,9 +42,10 @@ testthat::test_that("get_warnings accepts a qenv object with a single eval_code
4242
warning("This is a warning 1!")
4343
warning("This is a warning 2!")
4444
}))
45-
testthat::expect_identical( #TODO fix
45+
testthat::expect_identical( # TODO fix
4646
get_warnings(q),
47-
c("~~~ Warnings ~~~\n\n> This is a warning 1!\nwhen running code:\nwarning(\"This is a warning 1!\")\n\n> This is a warning 2!\nwhen running code:\nwarning(\"This is a warning 2!\")\n\n~~~ Trace ~~~\n\nwarning(\"This is a warning 1!\")",
47+
c(
48+
"~~~ Warnings ~~~\n\n> This is a warning 1!\nwhen running code:\nwarning(\"This is a warning 1!\")\n\n> This is a warning 2!\nwhen running code:\nwarning(\"This is a warning 2!\")\n\n~~~ Trace ~~~\n\nwarning(\"This is a warning 1!\")",
4849
"~~~ Warnings ~~~\n\n> This is a warning 1!\nwhen running code:\nwarning(\"This is a warning 1!\")\n\n> This is a warning 2!\nwhen running code:\nwarning(\"This is a warning 2!\")\n\n~~~ Trace ~~~\n\nwarning(\"This is a warning 2!\")"
4950
)
5051
)
@@ -55,7 +56,7 @@ testthat::test_that("get_warnings accepts a qenv object with 1 warning eval_code
5556
eval_code(bquote("x <- 1")) %>%
5657
eval_code(bquote(warning("This is a warning 2!")))
5758
testthat::expect_identical(
58-
get_warnings(q), #TODO fix
59+
get_warnings(q), # TODO fix
5960
paste0(
6061
"~~~ Warnings ~~~\n\n> This is a warning 2!\nwhen running code:\nwarning(\"This is a warning 2!\")\n\n",
6162
"~~~ Trace ~~~\n\nx <- 1\nwarning(\"This is a warning 2!\")"

tests/testthat/test-qenv_join.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ testthat::test_that("Joined qenv does not duplicate common code", {
4242
q@code,
4343
c("iris1 <- iris", "mtcars1 <- mtcars", "mtcars2 <- mtcars")
4444
)
45-
testthat::expect_identical(q@id, c(q1@id, q2@id[2])) #TODO fix
45+
testthat::expect_identical(q@id, c(q1@id, q2@id[2])) # TODO fix
4646
})
4747

4848
testthat::test_that("Not able to join two qenvs if any of the shared objects changed", {
@@ -72,7 +72,7 @@ testthat::test_that("join does not duplicate code but adds only extra code", {
7272
list(iris1 = iris, iris2 = iris, mtcars1 = mtcars, mtcars2 = mtcars)
7373
)
7474

75-
testthat::expect_identical(q@id, c(q1@id, q2@id[2])) #TODO - fix this
75+
testthat::expect_identical(q@id, c(q1@id, q2@id[2])) # TODO - fix this
7676
})
7777

7878
testthat::test_that("Not possible to join qenvs which share some code when one of the shared object was modified", {

tests/testthat/test-qenv_subset.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
testthat::test_that("subset extract proper objects", {
22
q <- qenv()
3-
code <- c("x<-1","a<-1;b<-2")
3+
code <- c("x<-1", "a<-1;b<-2")
44
q <- eval_code(q, code)
55
object_names <- c("x", "a")
66
qs <- subset(q, names = object_names)
@@ -9,7 +9,7 @@ testthat::test_that("subset extract proper objects", {
99

1010
testthat::test_that("subset extract proper code", {
1111
q <- qenv()
12-
code <- c("x<-1","a<-1;b<-2")
12+
code <- c("x<-1", "a<-1;b<-2")
1313
q <- eval_code(q, code)
1414
object_names <- c("x", "a")
1515
qs <- subset(q, names = object_names)
@@ -21,7 +21,7 @@ testthat::test_that("subset extract proper code", {
2121

2222
testthat::test_that("subset preservers comments in the code", {
2323
q <- qenv()
24-
code <- c("x<-1 #comment","a<-1;b<-2")
24+
code <- c("x<-1 #comment", "a<-1;b<-2")
2525
q <- eval_code(q, code)
2626
qs <- subset(q, names = c("x", "a"))
2727
testthat::expect_identical(
@@ -41,5 +41,4 @@ testthat::test_that("subset extract proper elements of @id, @warnings and @messa
4141
testthat::expect_identical(qs@code, q@code[c(1, 3)])
4242
testthat::expect_identical(qs@warnings, q@warnings[c(1, 3)])
4343
testthat::expect_identical(qs@messages, q@messages[c(1, 3)])
44-
4544
})

0 commit comments

Comments
 (0)