Skip to content

Commit

Permalink
Merge pull request #42 from shogo82148/sync-test-data-2024-01-08
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 authored Jan 8, 2024
2 parents 8d1caac + 5b2350d commit c579d36
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions testdata/structured-field-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The `expected` data structure maps the types in Structured Fields to [JSON](http
* String: JSON string; e.g., "foo"
* Token: `token` __type Object (see below)
* Binary Content: `binary` __type Object (see below)
* Boolean: JSON boolean; e.g., true
* Date: `date` __type Object (see below)
* Display String: `displaystring` __type Object (see below)
* Parameters: JSON array of arrays with two element, the param name and the param value
Expand Down
18 changes: 18 additions & 0 deletions testdata/structured-field-tests/display-string.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"header_type": "item",
"expected": [{"__type": "displaystring", "value": "foo bar"}, []]
},
{
"name": "all printable ascii",
"raw": ["%\" !%22#$%25&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\""],
"header_type": "item",
"expected": [{"__type": "displaystring", "value": " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"}, []]
},
{
"name": "non-ascii display string (uppercase escaping)",
"raw": ["%\"f%C3%BC%C3%BC\""],
Expand Down Expand Up @@ -36,6 +42,18 @@
"header_type": "item",
"must_fail": true
},
{
"name": "unquoted display string",
"raw": ["%foo"],
"header_type": "item",
"must_fail": true
},
{
"name": "display string missing initial quote",
"raw": ["%foo\""],
"header_type": "item",
"must_fail": true
},
{
"name": "unbalanced display string",
"raw": ["%\"foo"],
Expand Down

0 comments on commit c579d36

Please sign in to comment.