Skip to content
Tests for HTTP Structured Headers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md
README.md
binary.json
boolean.json
dictionary.json
generate.py
item.json
key-generated.json
large-generated.json
list.json
listlist.json
number.json
param-list.json
string-generated.json
string.json
token-generated.json
token.json

README.md

Structured Header Tests

These are test cases for implementations of Structured headers for HTTP.

Test Format

Each test file is a JSON document that contains an array of test records. A test record is an object with the following members:

  • name: A string describing the test
  • raw: An array of strings, each representing a header field value received
  • header_type: One of "item", "list", "dictionary", "param-list"
  • expected: The expected data structure after parsing (if successful). Required, unless must_fail is true.
  • must_fail: boolean indicating whether the test is required to fail. Defaults to false.
  • can_fail: boolean indicating whether failing this test is acceptable; for SHOULDs. Defaults to false.

The expected data structure maps the types in Structured Headers to JSON as follows:

  • Dictionary: JSON object
  • List: JSON array
  • List of Lists: JSON array of JSON arrays
  • Parameterised List: JSON array of JSON arrays whose first member is a string and second member is an object
  • Integer: JSON numbers; e.g. 1
  • Float: JSON numbers; e.g. 2.5
  • String: JSON string; e.g., "foo"
  • Token: JSON string; e.g., "bar"
  • Binary Content: base32-encoded string; e.g., "ZXW6==="

Writing Tests

All tests should have a descriptive name. Tests should be as simple as possible - just what's required to test a specific piece of behavior. If you want to test interacting behaviors, create tests for each behavior as well as the interaction.

Please feel free to contribute!

You can’t perform that action at this time.