:- use_module(library(plunit)).
:- use_module('../prolog/uk_plate_age').

:- begin_tests(uk_plate_age).

test(march)      :- age_identifier_period(24, 2024-3, 2024-8).
test(september)  :- age_identifier_period(74, 2024-9, 2025-2).
test(first)      :- age_identifier_period(51, 2001-9, 2002-2).
test(current)    :- age_identifier_period(76, 2026-9, 2027-2).
test(fifty, [fail])  :- age_identifier_period(50, _, _).
test(one, [fail])    :- age_identifier_period(1, _, _).
test(plate)      :- plate_period("ab24 cde", 2024-3, 2024-8).
test(spaces)     :- plate_period('AB 02 CDE', 2002-3, 2002-8).
test(prefix)     :- plate_period("P123 ABC", 1996-8, 1997-7).
test(prefix_s)   :- prefix_period('S', 1998-8, 1999-2).
test(prefix_y)   :- plate_period("y1 abc", 2001-3, 2001-8).
test(q, [fail])  :- plate_period("Q123 ABC", _, _).
test(dateless, [fail]) :- plate_period("ABC 123", _, _).
test(ni, [fail]) :- plate_period("ABZ 1234", _, _).
test(text)       :- plate_period_text("AB74 CDE", "September 2024 to February 2025").
test(year)       :- identifiers_for_year(2025, [25, 75]).
test(year2001)   :- identifiers_for_year(2001, [51]).

:- end_tests(uk_plate_age).
