@@ -269,18 +269,25 @@ tests() {
269269
270270 run_test " alpha_numeric: rejects empty" check_is_alpha_numeric 1 test_value " "
271271 run_test " alpha_numeric: rejects dot" check_is_alpha_numeric 1 test_value " ."
272- run_test " alpha_numeric: accepts simple token" check_is_alpha_numeric 0 test_value " test"
272+ run_test " alpha_numeric: rejects space" check_is_alpha_numeric 1 test_value " plain text"
273+ # run_test "alpha_numeric: rejects unicode" check_is_alpha_numeric 1 test_value "cafe"
274+ run_test " alpha_numeric: accepts token with dash/underscore" check_is_alpha_numeric 0 test_value " test_123-OK"
273275
274276 run_test " safe_filename: accepts simple name" validate_safe_filename 0 test_value " test"
277+ run_test " safe_filename: accepts spaces and punctuation" validate_safe_filename 0 test_value " plain text (v1) [ok].txt"
275278 run_test " safe_filename: rejects dot" validate_safe_filename 1 test_value " ."
276279 run_test " safe_filename: rejects double dot" validate_safe_filename 1 test_value " .."
277280 run_test " safe_filename: rejects embedded double dot" validate_safe_filename 1 test_value " test..test"
281+ run_test " safe_filename: rejects slash" validate_safe_filename 1 test_value " dir/file"
282+ run_test " safe_filename: rejects backslash" validate_safe_filename 1 test_value $' dir\\ file'
283+ run_test " safe_filename: rejects control char newline" validate_safe_filename 1 test_value $' hello\n world'
284+ run_test " safe_filename: rejects leading dash" validate_safe_filename 1 test_value " -rf"
285+ run_test " safe_filename: rejects overlong name" validate_safe_filename 1 test_value " $( printf ' a%.0s' {1..256}) "
278286
279287 run_test " one_line: rejects empty" check_is_not_empty_and_only_one_line 1 test_value " "
280288 run_test " one_line: rejects only whitespace/newlines" check_is_not_empty_and_only_one_line 1 test_value $' \n\n '
281- run_test " one_line: rejects only spaces" check_is_not_empty_and_only_one_line 1 test_value " "
282- run_test " one_line: accepts normal text" check_is_not_empty_and_only_one_line 0 test_value " Hello, World!"
283289 run_test " one_line: rejects multi-line string" check_is_not_empty_and_only_one_line 1 test_value $' Hello\n World'
290+ run_test " one_line: accepts normal text" check_is_not_empty_and_only_one_line 0 test_value " Hello, World!"
284291 run_test " one_line: accepts text with surrounding spaces" check_is_not_empty_and_only_one_line 0 test_value " Hello "
285292
286293 input_string=$' test1\n test2'
0 commit comments