From 653e4b6e47558eab0978bff13bbb627b16ab5e7c Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 17 Dec 2025 05:59:09 -0600 Subject: [PATCH] add: parsing test --- test/tests.json | 66 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/test/tests.json b/test/tests.json index 55d8b1c..421812e 100644 --- a/test/tests.json +++ b/test/tests.json @@ -1,30 +1,78 @@ { "parsing": { - "working": [ + "basic": [ { "title": "normal", "args": "1.1.1.1", "exit": 0 - }, + } + ], + "dns": [ { - "title": "dns", + "title": "normal", "args": "google.com", "exit": 0 - }, + } + ], + "ttl": [ { - "title": "ttl", + "title": "normal", "args": "1.1.1.1 --ttl 128", "exit": 0 }, { - "title": "preload", + "title": "too high", + "args": "1.1.1.1 --ttl 256", + "exit": 1 + }, + { + "title": "too low", + "args": "1.1.1.1 --ttl 0", + "exit": 1 + }, + { + "title": "negative", + "args": "1.1.1.1 --ttl -1", + "exit": 1 + } + ], + "preload": [ + { + "title": "normal", "args": "1.1.1.1 -p 1", "exit": 0 }, { - "title": "payload size", + "title": "negative", + "args": "1.1.1.1 -p -1", + "exit": 1 + }, + { + "title": "highest", + "args": "1.1.1.1 -p 2147483647", + "exit": 0 + }, + { + "title": "too high", + "args": "1.1.1.1 -p 2147483648", + "exit": 1 + } + ], + "payload_size": [ + { + "title": "normal", "args": "1.1.1.1 -s 1", "exit": 0 + }, + { + "title": "negative", + "args": "1.1.1.1 -s -1", + "exit": 1 + }, + { + "title": "too high", + "args": "1.1.1.1 -s 2147483648", + "exit": 1 } ] }, @@ -37,10 +85,6 @@ { "title": "empty payload", "args": "1.1.1.1 -s 0" - }, - { - "title": "too high", - "args": "1.1.1.1 -s " } ] }