<?php

require dirname(__DIR__) . '/prompts/generator_prompt.php';

function assertContains(string $haystack, string $needle, string $label): void
{
    if (!str_contains($haystack, $needle)) {
        echo 'FAIL: ' . $label . PHP_EOL;
        exit(1);
    }
    echo 'OK: ' . $label . PHP_EOL;
}

function assertNotContains(string $haystack, string $needle, string $label): void
{
    if (str_contains($haystack, $needle)) {
        echo 'FAIL: ' . $label . PHP_EOL;
        exit(1);
    }
    echo 'OK: ' . $label . PHP_EOL;
}

$note4 = aktYearLevelMetadataNote('4');
$note6 = aktYearLevelMetadataNote('6');
assertContains($note4, 'curation and output labelling only', 'metadata wording');
assertContains($note4, 'same MLA-style MS AKT clinical standard', 'consistent standard');
assertContains($note4, 'Do **not** make the vignette easier', 'instructs not to ease by year');
assertNotContains($note6, 'higher complexity vignettes', 'no legacy year-5 difficulty text');

$allowed = aktYearLevelAllowedFormValues();
if ($allowed !== ['4', '5', '6']) {
    echo 'FAIL: allowed year values' . PHP_EOL;
    exit(1);
}
echo 'OK: allowed year values' . PHP_EOL;

echo PHP_EOL . 'All year level metadata tests passed.' . PHP_EOL;
