RIVER OATH - WHAT THE TESTS CHECK
=================================

make test  (build/tests/rotests assets/data; --full for 100 campaigns a scenario)

Routes and seasons
  - flood channels open only in spring; fords only in autumn
  - the upper river freezes in winter and is walked without boats
  - boats cannot go up the shallow upper streams in autumn; downstream stays open
  - two river links downstream in one month, but not past a garrison, and never upstream
  - no boats, no river travel

Tasks
  - gathering gives Might x 4 (half in winter) plus up to 4
  - one task per place per month; a refused task changes nothing
  - dike repair: rice / 5 + Might, doubled for an engineer; the rice is spent
  - helping a town: +1 goodwill per 10 given, a tale of kindness, the stores spent
  - hurt characters only do light tasks; badly hurt ones only rest or travel; rest heals
  - raising men costs silver and is limited by the crew's size
  - no tasks where the band neither holds the place nor has its leader
  - no petition without the evidence

Tales
  - a strength-3 tale adds 15 goodwill where it is told
  - a tale spreads downstream in odd months, also upstream and by road in even months
  - a tale fades by 1 every three links

Upkeep, dikes and the flood
  - a band without rice loses men, and no store goes below zero
  - the Great Flood breaks every dike below 50 and spares those above

Endings
  - petition at Jade Lock with enough evidence and goodwill wins; not elsewhere
  - holding Jade Lock and the Tide Gate for 12 months wins
  - when 4 officials have fallen, the band with the most of them wins
  - the end of the last year with no winner ends the game with nobody winning
  - exposing an official: they flee, their garrison breaks up, the evidence is used

Battles
  - a battle the computer fights ends, and replaying its moves from the seed ends the same
  - a commander who flees loses the battle
  - a hopeless attack fails; attackers without rice lose
  - reserves wait and come in

A battle in a campaign
  - a person's raid stops for the person to fight it
  - saved halfway through the battle, loaded, and finished the same way: the same game

Offers and prisoners
  - a pact offered to another player waits for their turn, and is made when accepted
  - nobody ransoms a free wanderer; putting a prisoner to death makes a tale of cruelty

Saves
  - a broken save is refused and changes nothing; a newer format is named; a missing file is refused

Campaigns played by the computer (10 a scenario; 100 with --full)
  - after every month: no negative stores, garrisons or men, every link two-way,
    every person somewhere, every value in range (TGame.Validate)
  - every campaign ends (a winner, or the last year)
  - saved and loaded at several months: the loaded game is the same, and the
    next month (with its random numbers) comes out the same

Last full run (2026-11-07): 200 campaigns, 52,123 checks, all passed.
  Low Water: 79 of 100 won by a band (Tao Ming 51, Huo Baichuan 20, Xia Dongyun 6,
  Wen Shuyi 1, Gu Lanfeng 1, Ren Qiao 0). The Third Warning: 41 of 100 won.
  The computer bands are not balanced yet: Tao Ming's start is the strongest.

Parity with the browser edition
  - rotests --dump / --dump-online / --battle write saves and battles that the browser
    edition's self-test plays again and must match exactly, month by month
  - online mode: every human band acts in the open month, CloseMonth plays the rest

build/tests/uitest DIR  (no window)
  - the title, a new two-player campaign by keys, a taken leader refused,
    the hand-over screen, the main screen, the three map views, people, a
    character sheet, bands, officials, help
  - a month of tasks given by keys for both players, the month's ledger
  - save to slot 1 and load it through the menus; options
  - watching a computer-only campaign move on by itself
  - a raid fought on the battle screen: deploy all, move, let the computer
    finish, the result, the campaign valid afterwards
  - pictures of every screen go to DIR

make gui-test  (the real window, under xvfb)
  - the window opens on the title; a new campaign entirely by keys
  - every place on the map can be clicked through the window's scaling
  - the task menu, a task given and confirmed, the turn ended, the ledger,
    the next month, the autosave written
  The Windows exe (tools/build-win64.sh) passes the same test under Wine.
