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}
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