Skip to content

Commit ed2bb3a

Browse files
committed
coverage
1 parent c22491e commit ed2bb3a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

Diff for: tests/testthat/test-class_meta.R

+38
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,44 @@ tar_test("builder metadata recording", {
6767
expect_equal(nrow(db$read_data()), 1L)
6868
})
6969

70+
tar_test("meta$set_record()", {
71+
skip_cran()
72+
out <- meta_init()
73+
target <- target_init("x", quote(sample.int(100)))
74+
pipeline <- pipeline_init(list(target), clone_targets = FALSE)
75+
local <- local_init(pipeline)
76+
local$run()
77+
meta <- local$meta
78+
db <- meta$database
79+
db$ensure_storage()
80+
expect_gt(nrow(db$read_data()), 0L)
81+
db$reset_storage()
82+
expect_equal(nrow(db$read_data()), 0L)
83+
meta$database$lookup <- lookup_new()
84+
expect_false(meta$exists_record("x"))
85+
meta$set_record(target_produce_record(target, pipeline, meta))
86+
expect_true(meta$exists_record("x"))
87+
})
88+
89+
tar_test("meta$insert_row()", {
90+
skip_cran()
91+
out <- meta_init()
92+
target <- target_init("x", quote(sample.int(100)))
93+
pipeline <- pipeline_init(list(target), clone_targets = FALSE)
94+
local <- local_init(pipeline)
95+
local$run()
96+
meta <- local$meta
97+
db <- meta$database
98+
db$ensure_storage()
99+
expect_gt(nrow(db$read_data()), 0L)
100+
db$reset_storage()
101+
expect_equal(nrow(db$read_data()), 0L)
102+
meta$database$lookup <- lookup_new()
103+
expect_false(meta$exists_record("x"))
104+
meta$insert_row(list(name = "x", data = "y"))
105+
expect_true(meta$exists_record("x"))
106+
})
107+
70108
tar_test("meta$record_imports()", {
71109
envir <- new.env(parent = emptyenv())
72110
envir$f <- function(x) g(x) + h(x)

Diff for: tests/testthat/test-tar_visnetwork.R

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ tar_test("tar_visnetwork()", {
1010
)
1111
})
1212
out <- tar_visnetwork(
13+
label = c(
14+
"description",
15+
"time",
16+
"size",
17+
"branches"
18+
),
1319
callr_function = NULL,
1420
callr_arguments = list(show = FALSE)
1521
)

0 commit comments

Comments
 (0)