Next Previous Up Contents
Next: class
Up: Table Schemes
Previous: loop

#### 3.9.3 `test`

Usage: `:test:[<nrow>[,<opts-ibsufgvwmk*>]]`

Generates a table containing test data. The idea is to include columns of different data types, for instance to provide an example for testing I/O handler implementations. The columns will contain some variety of more or less meaningless values, but the content is reproducible between runs, so the same specification will produce the same output each time. Updates of the implementation might change the output however, so the output is not guaranteed to be the same for all time.

The table specification has two comma-separated parameters:

- `<nrow>`: row count
- `<opts>`: a string of letter options specifying what types of data will be included; options are:
  - i: an integer index column
  - b: a few basic columns
  - s: a selection of typed scalar columns
  - u: a string column containing some non-ASCII characters
  - f: a selection of fixed-length 1-d array columns
  - g: a selection of fixed-length 1-d array columns excluding strings
  - v: a selection of variable-length 1-d array columns
  - w: a selection of variable-length 1-d array columns excluding strings
  - m: a selection of multi-dimensional array columns
  - k: almost a thousand columns
  - *: equivalent to all of the above

If `<opts>` and/or `<nrow>` are omitted, some default values are used.

The `<nrow>` argument may be given as a plain integer (`1000`), or with embedded underscores (`1_000`), or in exponential format (`1e3`).

Example:

    :test:10,is
    +---------+--------+---------+-------+--------+---------+----------+----------------+-----------+
    | i_index | s_byte | s_short | s_int | s_long | s_float | s_double | s_string       | s_boolean |
    +---------+--------+---------+-------+--------+---------+----------+----------------+-----------+
    | 0       | 0      | 0       | 0     | 0      | 0.0     | 0.0      | zero           | false     |
    | 1       |        | 1       | 1     | 1      | 1.0     | 1.0      | one            | true      |
    | 2       | 2      |         | 2     | 2      | 2.0     | 2.0      | two            | false     |
    | 3       | 3      | 3       |       | 3      | 3.0     | 3.0      | three          | true      |
    | 4       | 4      | 4       | 4     |        | 4.0     | 4.0      | four           | false     |
    | 5       | 5      | 5       | 5     | 5      |         | 5.0      | five           | true      |
    | 6       | 6      | 6       | 6     | 6      | 6.0     |          | six            | false     |
    | 7       | 7      | 7       | 7     | 7      | 7.0     | 7.0      |                | true      |
    | 8       | 8      | 8       | 8     | 8      | 8.0     | 8.0      | ' "\""' ; '&<> |           |
    | 9       | 9      | 9       | 9     | 9      |         |          |                | true      |
    +---------+--------+---------+-------+--------+---------+----------+----------------+-----------+

Next Previous Up Contents
Next: class
Up: Table Schemes
Previous: loop

STIL - Starlink Tables Infrastructure Library
Starlink User Note252
STIL web page: http://www.starlink.ac.uk/stil/
Author email: m.b.taylor@bristol.ac.uk