Skip to content

Commit 4782b57

Browse files
Reset registry after tests to ensure clean state. Fixes rmd cmd check test error
1 parent 3ac74fd commit 4782b57

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

tests/testthat/test-DSL-parser.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
test_that("local edge/glyph registries exist for tests", {
66
# Minimal registries for tests
7-
.edge_ops_get <<- function() c("%-->%", "%<--%")
8-
.glyph_map_get <<- function() list("%-->%" = "-->", "%<--%" = "<--")
7+
.edge_ops_get <- function() c("%-->%", "%<--%")
8+
.glyph_map_get <- function() list("%-->%" = "-->", "%<--%" = "<--")
99

1010
expect_type(.edge_ops_get(), "character")
1111
expect_true("%-->%" %in% .edge_ops_get())
1212
expect_equal(.glyph_map_get()[["%-->%"]], "-->")
13+
reset_caugi_registry()
1314
})
1415

1516
# ──────────────────────────────────────────────────────────────────────────────
@@ -50,6 +51,7 @@ test_that(".contains_edge handles parentheses and returns FALSE otherwise", {
5051
# ──────────────────────────────────────────────────────────────────────────────
5152

5253
test_that(".glyph_of returns correct glyph", {
54+
reset_caugi_registry()
5355
expect_equal(.glyph_of(as.symbol("%-->%")), "-->")
5456
expect_equal(.glyph_of(as.symbol("%---%")), "---")
5557
expect_equal(.glyph_of(as.symbol("%<->%")), "<->")
@@ -67,6 +69,7 @@ test_that(".glyph_of returns correct glyph", {
6769
flags = "TRAVERSABLE_WHEN_CONDITIONED"
6870
)
6971
expect_equal(.glyph_of(as.symbol("%<--%")), "<--")
72+
reset_caugi_registry()
7073
})
7174

7275
test_that(".glyph_of returns NULL for unknown operator", {

tests/testthat/test-builder-rust.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ test_that("graph builder works for directed edge in reverse direction", {
3131

3232
expect_identical(parents_of_ptr(gptr, 0L), 1L)
3333
expect_identical(children_of_ptr(gptr, 1L), 0L)
34+
reset_caugi_registry()
3435
})
3536

3637
test_that("queries work for DAGs and PDAGs", {

0 commit comments

Comments
 (0)