Skip to content

Commit

Permalink
adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaobazzo committed Apr 24, 2023
1 parent a907d74 commit 0224ee6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test_ef_brazil_cetesb.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ test_that("ef_brazil_cetesb", {
)

# Expect equal tests -------
expect_equal(length(ef_brazil), 4)
expect_equal(length(ef_brazil$pollutant), 12)
expect_equal(length(ef_brazil$veh_type), 12)
expect_equal(length(ef_brazil$model_year), 12)
expect_equal(length(ef_brazil), 5)
expect_equal(length(ef_brazil$pollutant), 4)
expect_equal(length(ef_brazil$veh_type), 3)
expect_equal(length(ef_brazil$model_year), 3)
expect_equal(units::deparse_unit(ef_brazil$EF), "g km-1")
expect_true(is(ef_brazil$EF, "units"))
#expect_equal(as.numeric(sum(ef_brazil$EF,na.rm = TRUE)), 3837.902,0.1)
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test_ef_europe_emep.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ test_that("ef_europe_emep", {
euro = fleet_data_europe$euro)

# Expect equal -----
expect_equal(length(EF_europe), 9)
expect_equal(length(EF_europe$pollutant), 6)
expect_equal(length(EF_europe$veh_type), 6)
expect_equal(length(EF_europe$euro), 6)
expect_equal(length(EF_europe), 10)
expect_equal(length(EF_europe$pollutant), 2)
expect_equal(length(EF_europe$veh_type), 3)
expect_equal(length(EF_europe$euro), 3)
expect_equal(units::deparse_unit(EF_europe$EF$CO_Euro_II), "g km-1")
# expect_equal(sum(EF_europe$EF,na.rm = TRUE), 1188.842,0.1)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_ef_scaled_euro.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_that("ef_scaled_euro", {
pollutant = "CO")

expect_equal(names(result)
,c("pollutant", "veh_type", "euro", "fuel", "tech", "slope", "load", "speed","EF"))
,c("pollutant", "veh_type", "euro", "fuel", "tech", "process","slope", "load", "speed","EF"))
#expect_equal(as.numeric(result$EF),0.3370477,tolerance = 0.001)


Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_ef_usa_emfac.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("ef_usa_emfac", {
fuel = "D")

# Expect equal----
expect_equal(names(EF_usa),c("pollutant","model_year","fuel","EF" ))
expect_equal(names(EF_usa),c("pollutant","model_year","fuel","EF", "process"))
#expect_equal(as.numeric(sum(EF_usa$EF,na.rm = TRUE)), 195.2403, 0.01)

# Expect error----
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_ef_usa_moves.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("ef_usa_moves", {
fuel = "D")

# Expect equal----
expect_equal(names(EF_usa),c("pollutant" ,"model_year","fuel","EF"))
expect_equal(names(EF_usa),c("pollutant" ,"model_year","fuel","EF","process"))
#expect_equal(as.numeric(sum(EF_usa$EF,na.rm = TRUE)), 43671.76, 0.1)

# Expect error----
Expand Down

0 comments on commit 0224ee6

Please sign in to comment.