File trurl-395-exculdes-uppercase.patch of Package trurl

From cf31169316dad2357c1314f444b9eeffa99431eb Mon Sep 17 00:00:00 2001
From: Jacob Mealey <jacobmealey.maine@gmail.com>
Date: Sat, 5 Jul 2025 14:52:10 -0400
Subject: [PATCH] introduce 'excludes' option for tests, address hexadecimal
 changes from libcurl

Thanks @charles2910 for reporting this bug
fixes: #394
---
 test.py    |   7 ++-
 tests.json | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 trurl.c    |   2 +
 3 files changed, 132 insertions(+), 1 deletion(-)

diff --git a/test.py b/test.py
index f1c489c5..a7855656 100644
--- a/test.py
+++ b/test.py
@@ -250,11 +250,16 @@ def main(argc, argv):
                 print(f"Missing feature, skipping test {testIndex + 1}.")
                 numTestsSkipped += 1
                 continue
+            excludes = allTests[testIndex].get("excludes", None) 
+            if excludes and set(excludes).issubset(set(features)):
+                print(f"Test not compatible, skipping test {testIndex + 1}")
+                numTestsSkipped += 1
+                continue
             encoding = allTests[testIndex].get("encoding", None)
             if encoding and encoding != getcharmap():
                 print(f"Invalid locale, skipping test {testIndex + 1}.")
                 numTestsSkipped += 1
-                continue;
+                continue
 
             test = TestCase(testIndex + 1, runnerCmd, baseCmd, **allTests[testIndex])
 
diff --git a/tests.json b/tests.json
index 891271ca..10b995ae 100644
--- a/tests.json
+++ b/tests.json
@@ -702,6 +702,7 @@
                 "user=:hej:"
             ]
         },
+        "excludes": ["uppercase-hex"],
         "expected": {
             "stdout": "https://%3ahej%3a@curl.se/hello\n",
             "stderr": "",
@@ -2030,6 +2031,7 @@
                 "localhost"
             ]
         },
+        "excludes": ["uppercase-hex"],
         "expected": {
             "stdout": "/\\\\\n/%5c%5c\n",
             "returncode": 0,
@@ -2045,6 +2047,7 @@
                 "localhost"
             ]
         },
+        "excludes": ["uppercase-hex"],
         "expected": {
             "stdout": [
                 {
@@ -2071,6 +2074,7 @@
                 "localhost"
             ]
         },
+        "excludes": ["uppercase-hex"],
         "expected": {
             "stdout": "/%5c%5c\n/%5c%5c\n",
             "returncode": 0,
@@ -2089,6 +2093,7 @@
                 "localhost"
             ]
         },
+        "excludes": ["uppercase-hex"],
         "expected": {
             "stdout": [
                 {
@@ -3318,5 +3323,124 @@
             "stdout": "http://e/?e&a\n",
             "returncode": 0
         }
+    },
+    {
+        "input": {
+            "arguments": [
+                "-s",
+                "path=\\\\",
+                "--json",
+                "localhost"
+            ]
+        },
+        "required": ["uppercase-hex"],
+        "expected": {
+            "stdout": [
+                {
+                    "url": "http://localhost/%5C%5C",
+                    "parts": {
+                        "scheme": "http",
+                        "host": "localhost",
+                        "path": "/\\\\"
+                    }
+                }
+            ],
+            "returncode": 0,
+            "stderr": ""
+        }
+    },
+    {
+        "input": {
+            "arguments": [
+                "-s",
+                "path=\\\\",
+                "-g",
+                "{path}\\n{:path}",
+                "--urlencode",
+                "localhost"
+            ]
+        },
+        "required": ["uppercase-hex"],
+        "expected": {
+            "stdout": "/%5C%5C\n/%5C%5C\n",
+            "returncode": 0,
+            "stderr": ""
+        }
+    },
+    {
+        "input": {
+            "arguments": [
+                "-s",
+                "path=abc\\\\",
+                "-s",
+                "query:=a&b&a%26b",
+                "--urlencode",
+                "--json",
+                "localhost"
+            ]
+        },
+        "required": ["uppercase-hex"],
+        "expected": {
+            "stdout": [
+                {
+                    "url": "http://localhost/abc%5C%5C?a&b&a%26b",
+                    "parts": {
+                        "scheme": "http",
+                        "host": "localhost",
+                        "path": "/abc%5C%5C",
+                        "query": "a&b&a%26b"
+                    },
+                    "params": [
+                        {
+                            "key": "a",
+                            "value": ""
+                        },
+                        {
+                            "key": "b",
+                            "value": ""
+                        },
+                        {
+                            "key": "a&b",
+                            "value": ""
+                        }
+                    ]
+                }
+            ],
+            "returncode": 0,
+            "stderr": ""
+        }
+    },
+    {
+        "input": {
+            "arguments": [
+                "--url",
+                "https://curl.se/hello",
+                "--set",
+                "user=:hej:"
+            ]
+        },
+        "required": ["uppercase-hex"],
+        "expected": {
+            "stdout": "https://%3Ahej%3A@curl.se/hello\n",
+            "stderr": "",
+            "returncode": 0
+        }
+    },
+    {
+        "input": {
+            "arguments": [
+                "-s",
+                "path=\\\\",
+                "-g",
+                "{path}\\n{:path}",
+                "localhost"
+            ]
+        },
+        "required": ["uppercase-hex"],
+        "expected": {
+            "stdout": "/\\\\\n/%5C%5C\n",
+            "returncode": 0,
+            "stderr": ""
+        }
     }
 ]
diff --git a/trurl.c b/trurl.c
index f79b1791..5a3311d9 100644
--- a/trurl.c
+++ b/trurl.c
@@ -316,6 +316,8 @@ static void show_version(void)
 #ifdef SUPPORTS_ZONEID
   fprintf(stdout, " zone-id");
 #endif
+  if(data->version_num >= 0x080f00)
+    fprintf(stdout, " uppercase-hex");
 
   fprintf(stdout, "\n");
   exit(0);
openSUSE Build Service is sponsored by