Skip to content
Snippets Groups Projects
Commit c8a9ad30 authored by xo30xoqa's avatar xo30xoqa
Browse files

Added tests for units and AnnualDates

parent f89dc899
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ using
## define exported functions and variables
export
#types
AnnualDate,
Pixel,
Weather,
FarmEvent,
......
......@@ -106,6 +106,18 @@ end
end
@testset "Utility features" begin
#TODO units
#TODO AnnualDates
# units
import Persefone: Length, Area, m, km, , ha
@test 10000 == 1ha
@test 15000 / 1ha == 1.5
@test 1km / 5 == 200m
# AnnualDates
birthday::AnnualDate = (August, 21)
christmas::AnnualDate = (December, 24)
heute = Date(2024, 8, 8)
@test christmas - birthday == Day(125)
@test birthday - christmas == Day(240)
@test birthday > heute
@test heute + Week(2) - Day(1) == birthday
@test length(AnnualDate(heute):birthday) == 14
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment