Skip to content

Commit

Permalink
trurl: format null as \u0000 for --json
Browse files Browse the repository at this point in the history
Closes curl#214
  • Loading branch information
jacobmealey authored and bagder committed Aug 7, 2023
1 parent 1e83ccc commit 268c778
Show file tree
Hide file tree
Showing 2 changed files with 188 additions and 57 deletions.
84 changes: 84 additions & 0 deletions tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -2014,5 +2014,89 @@
"returncode": 0,
"stderr": ""
}
},
{
"input" : {
"arguments": [
"http:https://example.com/?q=mr%00smith",
"--json"
]
},
"expected": {
"stderr": "",
"returncode": 0,
"stdout": [
{
"url": "http:https://example.com/?q=mr%00smith",
"parts": {
"scheme": "http",
"host": "example.com",
"path": "/"
},
"params": [
{
"key": "q",
"value": "mr\u0000smith"
}
]
}
]
}
},
{
"input" : {
"arguments": [
"http:https://example.com/?q=mr%00sm%00ith",
"--json"
]
},
"expected": {
"stderr": "",
"returncode": 0,
"stdout": [
{
"url": "http:https://example.com/?q=mr%00sm%00ith",
"parts": {
"scheme": "http",
"host": "example.com",
"path": "/"
},
"params": [
{
"key": "q",
"value": "mr\u0000sm\u0000ith"
}
]
}
]
}
},
{
"input" : {
"arguments": [
"http:https://example.com/?q=mr%00%00%00smith",
"--json"
]
},
"expected": {
"stderr": "",
"returncode": 0,
"stdout": [
{
"url": "http:https://example.com/?q=mr%00%00%00smith",
"parts": {
"scheme": "http",
"host": "example.com",
"path": "/"
},
"params": [
{
"key": "q",
"value": "mr\u0000\u0000\u0000smith"
}
]
}
]
}
}
]
Loading

0 comments on commit 268c778

Please sign in to comment.