summaryrefslogtreecommitdiffstats
path: root/tests/core/io/test_file_access.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/io/test_file_access.h')
-rw-r--r--tests/core/io/test_file_access.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/core/io/test_file_access.h b/tests/core/io/test_file_access.h
index 243b75626f..a4d3fd1d70 100644
--- a/tests/core/io/test_file_access.h
+++ b/tests/core/io/test_file_access.h
@@ -38,25 +38,27 @@
namespace TestFileAccess {
TEST_CASE("[FileAccess] CSV read") {
- Ref<FileAccess> f = FileAccess::open(TestUtils::get_data_path("translations.csv"), FileAccess::READ);
+ Ref<FileAccess> f = FileAccess::open(TestUtils::get_data_path("testdata.csv"), FileAccess::READ);
REQUIRE(!f.is_null());
Vector<String> header = f->get_csv_line(); // Default delimiter: ",".
- REQUIRE(header.size() == 3);
+ REQUIRE(header.size() == 4);
Vector<String> row1 = f->get_csv_line(","); // Explicit delimiter, should be the same.
- REQUIRE(row1.size() == 3);
+ REQUIRE(row1.size() == 4);
CHECK(row1[0] == "GOOD_MORNING");
CHECK(row1[1] == "Good Morning");
CHECK(row1[2] == "Guten Morgen");
+ CHECK(row1[3] == "Bonjour");
Vector<String> row2 = f->get_csv_line();
- REQUIRE(row2.size() == 3);
+ REQUIRE(row2.size() == 4);
CHECK(row2[0] == "GOOD_EVENING");
CHECK(row2[1] == "Good Evening");
CHECK(row2[2].is_empty()); // Use case: not yet translated!
// https://github.com/godotengine/godot/issues/44269
CHECK_MESSAGE(row2[2] != "\"", "Should not parse empty string as a single double quote.");
+ CHECK(row2[3] == "\"\""); // Intentionally testing only escaped double quotes.
Vector<String> row3 = f->get_csv_line();
REQUIRE(row3.size() == 6);