Skip to content

Commit

Permalink
C++ tests: fixed an issue with a Japanese character in our File-relat…
Browse files Browse the repository at this point in the history
…ed tests.
  • Loading branch information
agarny authored Nov 26, 2024
2 parents 670cb69 + f11b646 commit 3205f69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
14 changes: 3 additions & 11 deletions tests/api/file/i18ntests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 3 additions & 3 deletions tests/bindings/python/test_file_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3205f69

Please sign in to comment.