Skip to content

Commit f58caac

Browse files
committed
Add test cases for unicode filenames
1 parent 27c53b0 commit f58caac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+108
-1
lines changed

clitests/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ set(CASELIST
1515
tests/info/invalid_file.json
1616
tests/info/sample.json
1717
tests/info/stdin.json
18+
tests/info/unicode_filenames.json
1819

1920
tests/validate/cli_errors.json
2021
tests/validate/help.json
2122
tests/validate/stdin.json
23+
tests/validate/unicode_filenames.json
2224

2325
tests/validate/fatal_1003_UnexpectedEOF.json
2426
tests/validate/fatal_2001_NotKTX2.json
@@ -227,6 +229,7 @@ set(CASELIST
227229
tests/extract/raw_zstd.json
228230
tests/extract/stdin.json
229231
tests/extract/stdout.json
232+
tests/extract/unicode_filenames.json
230233

231234
tests/create/astc_params.json
232235
tests/create/3d_with_1_depth.json
@@ -298,6 +301,7 @@ set(CASELIST
298301
tests/create/sample_zstd.json
299302
tests/create/stdin.json
300303
tests/create/stdout.json
304+
tests/create/unicode_filenames.json
301305

302306
tests/encode/compare.json
303307
tests/encode/encode_blze.json
@@ -313,10 +317,12 @@ set(CASELIST
313317
tests/encode/help.json
314318
tests/encode/stdin.json
315319
tests/encode/stdout.json
320+
tests/encode/unicode_filenames.json
316321

317322
tests/transcode/help.json
318323
tests/transcode/stdin.json
319324
tests/transcode/stdout.json
325+
tests/transcode/unicode_filenames.json
320326
tests/transcode/transcode_blze.json
321327
tests/transcode/transcode_error_invalid.json
322328
tests/transcode/transcode_error_not_transcodable.json

clitests/clitest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import argparse
77
import os
8+
import sys
89
import subprocess
910
import re
1011
import json
@@ -71,13 +72,17 @@ def cmdArgs(self):
7172
cli_args, unknown_args = parser.parse_known_args()
7273

7374

75+
# Use UTF-8 output
76+
sys.stdout.reconfigure(encoding='utf-8')
77+
78+
7479
# Load JSON test case description and check basic contents
7580

7681
if not os.path.isfile(cli_args.json_test_file):
7782
print(f"ERROR: Cannot find JSON test file '{cli_args.json_test_file}'")
7883
exit(1)
7984

80-
f = open(cli_args.json_test_file)
85+
f = open(cli_args.json_test_file, encoding='utf-8')
8186
testcase = json.load(f)
8287
f.close()
8388

1.26 KB
Binary file not shown.
1.26 KB
Binary file not shown.
1.26 KB
Binary file not shown.
1.26 KB
Binary file not shown.
1.26 KB
Binary file not shown.
406 Bytes
Binary file not shown.
406 Bytes
Binary file not shown.
406 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)