From 4de8795467cdb5b2ab1b5b8e7f84e4919b372817 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 12 Sep 2024 16:45:06 +0200 Subject: [PATCH] tests.json: add tests extracing URL encoded components --- tests.json | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/tests.json b/tests.json index 238d4624..83ea422a 100644 --- a/tests.json +++ b/tests.json @@ -391,6 +391,81 @@ "returncode": 0 } }, + { + "input": { + "arguments": [ + "--url", + "https://curl.se/we/are.html", + "--get", + "{:scheme}" + ] + }, + "expected": { + "stdout": "https\n", + "stderr": "", + "returncode": 0 + } + }, + { + "input": { + "arguments": [ + "--url", + "https://curl.se:55/we/are.html", + "--get", + "{url:port}" + ] + }, + "expected": { + "stdout": "55\n", + "stderr": "", + "returncode": 0 + } + }, + { + "input": { + "arguments": [ + "--url", + "https://curl.se/%2e%61%13", + "--get", + "{:path}" + ] + }, + "expected": { + "stdout": "/.a%13\n", + "stderr": "", + "returncode": 0 + } + }, + { + "input": { + "arguments": [ + "--url", + "https://curl.se?%2e%61%13", + "--get", + "{:query}" + ] + }, + "expected": { + "stdout": ".a%13\n", + "stderr": "", + "returncode": 0 + } + }, + { + "input": { + "arguments": [ + "--url", + "https://curl.se/#%2e%61%13", + "--get", + "{:fragment}" + ] + }, + "expected": { + "stdout": "%2e%61%13\n", + "stderr": "", + "returncode": 0 + } + }, { "input": { "arguments": [