Skip to content

Commit

Permalink
correct the h2 test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kdorheim committed Aug 6, 2024
1 parent 78ad20b commit af45bee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/testthat/test-h2.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ test_that("tau ", {
run(hc)
out <- fetchvars(hc, dates = 1750:2100, vars = LIFETIME_OH())

head(out)


expect_equal(LIFETIME_OH(), "TAU_OH")
expect_lte(mean(out$value), 8)
expect_gte(mean(out$value), 6.6)
Expand Down Expand Up @@ -43,12 +46,12 @@ test_that("H2 emissions ", {
diff <- abs(out$value - out2$value)

# As of now the [CH4] and tau oh should not change
expect_equal(unique(diff[out$variable == CONCENTRATIONS_CH4()]), 0)
expect_equal(unique(diff[out$variable == LIFETIME_OH()]), 0)
expect_equal(mean(diff[out$variable == CONCENTRATIONS_CH4()]), 0)
expect_equal(mean(diff[out$variable == LIFETIME_OH()]), 0)

# But if we can change the H2 emissions we should see a difference in
# H2 emissions between the two new runs!
expect_equal(unique(diff[out$variable == EMISSIONS_H2()]), new_val)
expect_equal(mean(diff[out$variable == EMISSIONS_H2()]), new_val)

})

Expand Down

0 comments on commit af45bee

Please sign in to comment.