How we
test it
£12 is a low price for software whose output goes on a tax return, and "trust us" is not an answer to that. So here is what is actually tested, what is deliberately not, and how you can check the claim yourself.
In numbers
27
HS284 assertions
Against HMRC's own published worked examples. Each names its example and quotes the figure it asserts.
325
Tests on every build
The whole suite runs on every commit. A red engine lane blocks the merge.
3
Matching rules pinned
Same-day, 30-day and Section 104 — each with its boundaries tested on both sides.
0
Floating-point money
Every figure is an exact decimal from end to end. Money is never a binary float, anywhere.
What HS284 is
HS284 is HMRC's own helpsheet, "Shares and Capital Gains Tax". It explains the pooling and matching rules and works three examples all the way through to a chargeable gain — with figures. That makes it the closest thing to an official answer key that exists for this calculation, and it is what GainPool is tested against.
The distinction we insist on
HS284's three examples give figures. The Section 104 arithmetic, the same-day rule and the ordering of the three rules are stated as a method, not tabulated. Those are two different kinds of evidence and we do not blur them:
- Where HMRC publishes a number, we assert that number exactly, and the test's comment quotes it.
- Where HMRC states a method, we assert hand-worked fixtures derived strictly from that method, with the full derivation written above the test so a reviewer can re-derive it instead of trusting it.
A test that says "HMRC's figure" when it means "our arithmetic" is worth less than no claim at all.
Example 3, worked end to end
HMRC's Example 3 — two disposals from one pool — is asserted in full, including the part that catches people out.
On rounding, which is the subtle part: the engine keeps full precision inside the pool and does not round to the penny between disposals, so its carried-forward cost differs slightly from HMRC's rounded illustration. Both chargeable gains still land exactly on HMRC's published figures once rounded to whole pounds for the return — and the test pins both the exact arithmetic and the rounded agreement, because that is the property that actually matters.
You can run this example yourself, right now, in the Section 104 calculator — it runs the same engine, in your browser.
What the 325 tests cover
| Suite | Tests | What it holds |
|---|---|---|
| Engine unit tests | 173 | Every rule and boundary, including the matching order itself |
| hs284_pool | 27 | HMRC's published worked examples |
| gainpool-pack | 19 | The computation pack: pagination that never breaks mid-record |
| platform_detection | 17 | Which broker a file is, from its columns alone |
| fixture_regressions | 15 | Real file shapes that once broke something |
| trading212_import | 13 | The one importer validated against a real export |
| wizard_flow | 11 | The mapping wizard's route, end to end |
| sa108_boxes | 9 | The numbers that go in each box of the return |
| split_rate_year_2024_25 | 9 | The 30 October 2024 rate change, mid-year |
| diagnostic_leaks | 8 | That an error message cannot leak your holdings |
| import_remedies | 8 | That a failure tells you what to do about it |
| provenance | 5 | That every figure can name the file it came from |
| Others | 11 | CLI, profile preference, README/profile agreement, doc-tests |
| Total | 325 | Run on every commit, on Linux, macOS and Windows |
Counted from the suite on 31 July 2026. If these numbers are stale, the suite is right and this page is wrong — tell us.
What is deliberately not tested, because it is not in scope
The honest half of this page. GainPool covers GBP-denominated shares, ETFs and securities, with foreign-currency trades converted at the rate in your export. It does not compute, and does not pretend to:
- Options, futures, CFDs and spread bets
- Property, or anything reported outside the listed-securities section of the SA108
- Business Asset Disposal Relief, Investors' Relief, EIS/SEIS deferral, and other reliefs
- Excess reportable income on offshore funds — planned, not present
- Trusts, estates, partnerships, and non-resident or split-year cases
The same list is inside the application, on screen, before any figures are shown — not buried in a licence agreement afterwards.
Check it yourself
Nothing here asks to be taken on faith. The engine is a Rust library with no GUI dependencies, so the tax logic can be exercised without installing an application:
Every assertion in that first suite carries a comment naming its HS284 example and quoting the figure, so you can put the helpsheet beside the output and match them line by line.
Found something wrong? A demonstrated error in the tax arithmetic is the most valuable thing anyone can send us. hello@longstopsoftware.com — a person reads it, and a fix ships with a test that pins it.
Every figure,
with its working attached.
GainPool exports a computation pack that shows how each number was reached — the document you would want if anyone ever asked.