Skip to content

Commit ae284ae

Browse files
committed
tests 37
Signed-off-by: Julio Jimenez <julio@clickhouse.com>
1 parent a7a76d3 commit ae284ae

2 files changed

Lines changed: 6 additions & 22 deletions

File tree

license-mappings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,12 @@
476476
"github.com/gosuri/uitable": "MIT",
477477
"github.com/grafana/grafana-foundation-sdk/go": "Apache-2.0",
478478
"github.com/grafana/regexp": "BSD-3-Clause",
479+
"github.com/gregjones/httpcache": "MIT",
480+
"github.com/grpc-ecosystem/go-grpc-middleware": "Apache-2.0",
481+
"github.com/grpc-ecosystem/go-grpc-middleware/v2": "Apache-2.0",
482+
"github.com/grpc-ecosystem/go-grpc-prometheus": "Apache-2.0",
483+
"github.com/grpc-ecosystem/grpc-gateway/v2": "BSD-3-Clause",
484+
"github.com/guptarohit/asciigraph": "BSD-3-Clause",
479485
"github.com/Jeffail/gabs/v2": "MIT",
480486
"github.com/klauspost/compress": "BSD-3-Clause",
481487
"github.com/lufia/plan9stats": "BSD-3-Clause",

test/advanced.bats

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,6 @@ EOF
822822
# Test with mixed ASCII and control characters
823823
local mixed_string=$(printf "test\x1b[31mred\x1b[0mnormal")
824824
run sanitize_string "$mixed_string"
825-
echo "$output"
826-
echo "$status"
827825
[ "$status" -eq 0 ]
828826
[[ "$output" == "test31mred0mnormal" ]]
829827
}
@@ -832,8 +830,6 @@ EOF
832830
@test "sanitize_repository handles locales with special characters" {
833831
# Note: This should fail validation as our regex is ASCII-only
834832
run sanitize_repository "üser/repö"
835-
echo "$output"
836-
echo "$status"
837833
[ "$status" -eq 0 ]
838834
[[ "$output" == "ser/rep" ]]
839835
}
@@ -924,17 +920,13 @@ EOF
924920
# Test 53: sanitize_numeric handles leading zeros
925921
@test "sanitize_numeric handles leading zeros" {
926922
run sanitize_numeric "00123" "TEST_FIELD"
927-
echo "$output"
928-
echo "$status"
929923
[ "$status" -eq 0 ]
930924
[[ "$output" == "00123" ]]
931925
}
932926

933927
# Test 54: sanitize_uuid handles minimum valid length
934928
@test "sanitize_uuid handles minimum valid length" {
935929
run sanitize_uuid "12345678" "TEST_UUID"
936-
echo "$output"
937-
echo "$status"
938930
[ "$status" -eq 1 ]
939931
[[ "$output" == *"Invalid UUID format"* ]]
940932
}
@@ -1015,8 +1007,6 @@ EOF
10151007
export EXCLUDE="*.txt|cat /etc/passwd"
10161008

10171009
run sanitize_inputs
1018-
echo "$output"
1019-
echo "$status"
10201010
[ "$status" -eq 0 ] # Handles sanitization without crashing
10211011

10221012
# Check that dangerous characters were removed or validation failed
@@ -1035,8 +1025,6 @@ EOF
10351025
export S3_BUCKET="$null_bucket"
10361026

10371027
run sanitize_inputs
1038-
echo "$output"
1039-
echo "$status"
10401028
[ "$status" -eq 0 ]
10411029
[[ "$output" == *"Input sanitization completed successfully"* ]]
10421030
}
@@ -1050,8 +1038,6 @@ EOF
10501038
export GITHUB_TOKEN="$control_string"
10511039

10521040
run sanitize_inputs
1053-
echo "$output"
1054-
echo "$status"
10551041
[ "$status" -eq 0 ]
10561042

10571043
# Control characters should be removed
@@ -1071,8 +1057,6 @@ EOF
10711057
export MEND_PROJECT_UUIDS="123e4567-e89b-12d3-a456-426614174000,456e7890-e89b-12d3-a456-426614174001"
10721058

10731059
run sanitize_inputs
1074-
echo "$output"
1075-
echo "$status"
10761060
[ "$status" -eq 0 ]
10771061

10781062
# All valid inputs should be preserved
@@ -1089,8 +1073,6 @@ EOF
10891073
local huge_string=$(printf 'a%.0s' {1..50000})
10901074

10911075
run sanitize_string "$huge_string" 1000
1092-
echo "$output"
1093-
echo "$status"
10941076
[ "$status" -eq 0 ]
10951077
[ "${#output}" -eq 1000 ]
10961078
}
@@ -1105,8 +1087,6 @@ EOF
11051087
many_patterns=${many_patterns:1} # Remove leading comma
11061088

11071089
run sanitize_patterns "$many_patterns"
1108-
echo "$output"
1109-
echo "$status"
11101090
[ "$status" -eq 0 ]
11111091
[[ "$output" == *"pattern1*.json"* ]]
11121092
[[ "$output" == *"pattern100*.json"* ]]
@@ -1148,8 +1128,6 @@ EOF
11481128
export GITHUB_TOKEN="github-token"
11491129

11501130
run sanitize_inputs
1151-
echo "$output"
1152-
echo "$status"
11531131
[ "$status" -eq 0 ]
11541132
[[ "$output" == *"Input sanitization completed successfully"* ]]
11551133
}

0 commit comments

Comments
 (0)