empserver/tests/load-tend/03-tend-1
Markus Armbruster 68945c8ff8 tests/load-tend: New; exercises load and tend commands
Exercise load, unload, lload, lunload, tend, and ltend.

Notable coverage gaps:

* Effect on land unit fortification

* Effect on mission and retreat orders

* Ships, land units and planes on sale (option MARKET 1)

* Transmission of plague (option NO_PLAGUE 0)

* Land units loading and unloading civilians (need a custom land unit
  type capable of carrying civilians)

* load refusing to load x-light planes (need a custom ship type that
  can carry helo but not x-light)

* load and lload refusing to load land units carrying land units, and
  lload refusing to load land units onto land units that are being
  carried (need a custom non-heavy land unit type that can carry land
  units)

* tend refusing to tend non-light land units to non-supply ships, or
  to supply ships without room (need custom a non-light assault land
  unit type)

This test exposes bugs.  They're marked "BUG:" in the test input.
There are also oddities marked "odd:", and usability issues marked
"usability:".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:25:15 +01:00

202 lines
4.1 KiB
Text

||| General tend rules
|
| tender and target must be in the same sector
| only own ships can tend
| only own and friendly ships can be tended to
| a ship doesn't tend to itself
|
| ships (in 1,-1 unless stated otherwise)
| cs#150/.../153 (fleet t)
| cs#160/162/163/164 (fleet u) in 0,-2, owned by #0/2/3/4
| ls#165
| cs#166 in 0,-2
| frg#170/sb#171/cs#172/sbc#173 land tendees, sub x supply
| cs#175 land tendee
|
| lands:
| sup#300/linf#301/302/303/hat#304 (army t) riding fleet t
| linf#312/231/314 (army u) riding fleet u
| linf#315/316/317 riding ls#165
| spy#320/321/323 (army s) riding ls#165
| linf#330/331 riding cs#166
|
||| tend commodities
|
|| general sanity
| invalid commodity
tend x
| invalid tender
tend f -1
| no tenders match
tend f n
| foreign tender
tend f 160/162/163/164
| usability: does nothing silently
| invalid amount
| impossible, as crap is mapped to zero
| invalid target
tend f 150 1 -1
| no targets match
tend f 150 1 n
|
|| tender/target pairs that can't
| targeting self:
tend f 150 1 150
| target not in same sector:
tend f 150 1 0
| usability: does nothing silently
|
|| from own ships to own ships:
| #150/151 give 4m each
| #150/151 receive 1m each, #152/153/154 2m
tend m 150/151 1 t
| likewise, civilians: same result
tend c 150/151 1 t
| likewise, zero amount: fails
tend m 150/151 0 t
| likewise, negative amount:
| #150/151 receive 4m each
| #150/151 give 1m each, #152/153/154 2m
tend u 150/151 -1 t
|| from own ships to foreign ships:
| list: #166 give 2f, #162/163 receive 1f each
tend f 166 1 160/162/163/164
| group: same
| odd: can use foreign fleet assignment
tend f 166 1 u
| area: same
realm 2 0,-2
tend f 166 1 #2
tend f 166 1 0,-2
tend f 166 1 -1:1,-2
| civilians don't work:
tend c 166 1 160/162/163/164
| negative amount doesn't work:
tend f 160/162/163/164 -1 166
|| from foreign ships to own ships doesn't work:
tend f 166 -1 160/162/163/164
|
|| tend something the tender can't hold
tend h 170/171 1 150
tend h 150 -1 170/171
|
|| tend something the tender doesn't have
tend h 150/152 1 151
tend h 151 -1 150/152
| odd: first command fails, second doesn't
|
|| tend something the target can't hold
tend u 150 1 170/171
tend u 170/171 -1 150
| odd: only the second command reports "cannot hold"
|
|| tend more than the tender has
| #150 gives 7s, #152 gives 9s
| #150 receives 5s, #151 9s, #152 receives 2s
tend s 150/152 5 t
| #152/154 give 7s each, #150 receives 10s, #151 receive 4s
tend s t -5 153/154
|
|| tend more then the target can hold
| #151 gives 5g, #152 gives 3g
| #150 receives 8g
tend g t 5 150
| #150 gives 8g to #153
tend g 153 -40 t
|
|| interactive
tend
x
tend
f
-1
tend
f
150
x
tend
f
150/151
1
153
-1
154
|
||| tend lands
|
|| general sanity
| invalid tender
tend land -1
| foreign tender
tend land 160/162/163/164
| usability: does nothing silently
| invalid land
tend land 150 -1
| invalid target
tend land 151 301 -1
|
|| tender/target pairs that can't
| no ships match
tend land n
tend land 151 301 n
| targeting self:
tend land 151 301 151
| target not friendly
tend land 166 330 164
| target not in same sector
tend land 151 301 0
| usability: does nothing silently
|
|| lands that can't be tended
| no lands match
tend land 150 n 151
| not capable: lacks assault (#300)
tend land 150 * 151
| usability: lots of useless "not on this ship" complaints
| not on tender
tend land 150 301 150
| carrying civilians, to foreign ship
| TODO need a land unit that can carry c to test this
|
|| target's load limits
| usability: lots of useless "not on this ship" complaints
| can't carry non-light
| TODO need a non-light assault land unit to test this
| can't carry light (only spies)
tend land 151 301 171/173
| no room for non-light
| TODO need a non-light assault land unit to test this
| no room for light (transfers first 2)
tend land t 301/302/303 170
| no room for spy (transfers first 2)
tend land 165 320/321/322 171
tend land 165/171 s 173
| spy can use light and non-light slot
tend land 173 s 150/165
| BUG: #173 transfers spy first to #150, then same spy to #165
|
|| to foreign ships
tend land 166 330 162
tend land 166 331 163
|
|| interactive
tend
land
!
tend
land
-1
tend
land
165
-1
tend
land
165
322
-1
tend
land
165
322
172