---
title: "std.testing"
url: https://una-lang.org/en/docs/std/testing/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/listing.json
---

# std.testing

The items of `std.testing`, usable only in test code ([`spec/14 §4`](https://una-lang.org/en/docs/spec/14-standard-library/#s4)), one page each.

Operators, comparisons, equality and interpolation are built in and not listed here ([`spec/14 §2`](https://una-lang.org/en/docs/spec/14-standard-library/#s2)). The built-in methods, `.len` and those of maps and of fixed-width integers, are on [Built-in methods](https://una-lang.org/en/docs/std/builtin/).

## Types

- [`TestRequestError`](https://una-lang.org/en/docs/std/testing/TestRequestError/): Why `test_request` refuses a request: the host would answer it `400` (ADR 0123 rule 21, `spec/31 §4`). (0.4, 0.5 preview)

## Functions

- [`fake_hash`](https://una-lang.org/en/docs/std/testing/fake_hash/): A deterministic `Hashed` value for tests: equal seeds give equal values. (0.1 and later)
- [`elapse`](https://una-lang.org/en/docs/std/testing/elapse/): Moves the test's virtual clock forward by `d` at once, without waiting (ADR 0116 rule 19, `spec/26 §8`). (0.4, 0.5 preview)
- [`test_request`](https://una-lang.org/en/docs/std/testing/test_request/): A request as the host would read it from a peer (ADR 0123 rule 21, `spec/31 §4`): its target read by the host's own rules, the only header `host: test`, the peer `192.0.2.1` and the listener `test`. (0.4, 0.5 preview)
- [`test_exchange`](https://una-lang.org/en/docs/std/testing/test_exchange/): An exchange of `request` with a fresh reply right, distinct from every other reply right of the run (ADR 0123 rule 21, `spec/31 §1`). (0.4, 0.5 preview)

Generated from the standard modules of una v0.4.0 ([`docs/std/listing.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/listing.json), which is not part of the specification). The specification governs: [`spec/14 §1`](https://una-lang.org/en/docs/spec/14-standard-library/#s1).
