From f11b646788700a30d1700d9e1728e020d5e716dd Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Tue, 26 Nov 2024 17:55:08 +1300 Subject: [PATCH] C++ tests: fixed an issue with a Japanese character in our File-related tests. --- tests/api/file/i18ntests.cpp | 14 +++----------- tests/bindings/python/test_file_i18n.py | 6 +++--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/api/file/i18ntests.cpp b/tests/api/file/i18ntests.cpp index 0f3622d2c..b73e48dfb 100644 --- a/tests/api/file/i18ntests.cpp +++ b/tests/api/file/i18ntests.cpp @@ -39,20 +39,12 @@ TEST(I18nFileTest, hindiFiles) EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/फोल्डर/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); } -#ifdef BUILDING_ON_MACOS TEST(I18nFileTest, japaneseFiles) { - // Note: the フォルダ folder was created on macOS and although it can be accessed on Windows, Linux, and macOS using - // their respective file manager, it can only be accessed programmatically on macOS. On Windows, for instance, - // a dakuten (and, most likely, a handakuten) is handled in a special way. So, this test will always fail on - // Windows. Something similar happens on Linux. So, in the end, we keep the macOS version of the folder name - // and only run this test on macOS. - - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); } -#endif TEST(I18nFileTest, russianFiles) { diff --git a/tests/bindings/python/test_file_i18n.py b/tests/bindings/python/test_file_i18n.py index 7e4fc0ca4..b5710d51f 100644 --- a/tests/bindings/python/test_file_i18n.py +++ b/tests/bindings/python/test_file_i18n.py @@ -71,15 +71,15 @@ def test_japanese_files(): if platform.system() == "Darwin": assert ( - oc.File(utils.resource_path("i18n/フォルダ/file.cellml")).type + oc.File(utils.resource_path("i18n/フォルダ/file.cellml")).type == oc.File.Type.CellmlFile ) assert ( - oc.File(utils.resource_path("i18n/フォルダ/file.sedml")).type + oc.File(utils.resource_path("i18n/フォルダ/file.sedml")).type == oc.File.Type.SedmlFile ) assert ( - oc.File(utils.resource_path("i18n/フォルダ/file.omex")).type + oc.File(utils.resource_path("i18n/フォルダ/file.omex")).type == oc.File.Type.CombineArchive ) else: