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 ...@@ -42,6 +42,7 @@ using
## define exported functions and variables ## define exported functions and variables
export export
#types #types
AnnualDate,
Pixel, Pixel,
Weather, Weather,
FarmEvent, FarmEvent,
......
...@@ -106,6 +106,18 @@ end ...@@ -106,6 +106,18 @@ end
end end
@testset "Utility features" begin @testset "Utility features" begin
#TODO units # units
#TODO AnnualDates 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 end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment