Skip to content

Commit af45bee

Browse files
committed
correct the h2 test bug
1 parent 78ad20b commit af45bee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/testthat/test-h2.R

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ test_that("tau ", {
1313
run(hc)
1414
out <- fetchvars(hc, dates = 1750:2100, vars = LIFETIME_OH())
1515

16+
head(out)
17+
18+
1619
expect_equal(LIFETIME_OH(), "TAU_OH")
1720
expect_lte(mean(out$value), 8)
1821
expect_gte(mean(out$value), 6.6)
@@ -43,12 +46,12 @@ test_that("H2 emissions ", {
4346
diff <- abs(out$value - out2$value)
4447

4548
# As of now the [CH4] and tau oh should not change
46-
expect_equal(unique(diff[out$variable == CONCENTRATIONS_CH4()]), 0)
47-
expect_equal(unique(diff[out$variable == LIFETIME_OH()]), 0)
49+
expect_equal(mean(diff[out$variable == CONCENTRATIONS_CH4()]), 0)
50+
expect_equal(mean(diff[out$variable == LIFETIME_OH()]), 0)
4851

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

5356
})
5457

0 commit comments

Comments
 (0)