Skip to content

Commit

Permalink
Add start of parsing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Jun 14, 2024
1 parent 1e765ad commit eacd9fe
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/testthat/test-parse.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test_that("can parse trivial system", {
res <- odin_parse({
initial(x) <- 0
update(x) <- 0
})
expect_equal(res$time, "discrete")
expect_equal(res$class, "odin")
expect_mapequal(
res$location,
list(contents = list(variables = "x",
shared = character(),
internal = character(),
data = character(),
output = character(),
stack = character()),
location = c(x = "state"),
type = c(x = "real_type"),
packing = list(state = list(x = 0))))
})

0 comments on commit eacd9fe

Please sign in to comment.