[education/rkward] rkward/autotests: Merge encoding related tests

Thomas Friedrichsmeier null at kde.org
Thu Sep 4 20:46:54 BST 2025


Git commit 940ccfc488ef08e7a69576202af883937650dacc by Thomas Friedrichsmeier.
Committed on 04/09/2025 at 14:54.
Pushed by tfry into branch 'master'.

Merge encoding related tests

M  +11   -13   rkward/autotests/core_test.cpp

https://invent.kde.org/education/rkward/-/commit/940ccfc488ef08e7a69576202af883937650dacc

diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index 327ede67f..0a065ab39 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -239,6 +239,17 @@ class RKWardCoreTest : public QObject {
 			QCOMPARE(command->stringVector().value(0).count(test_string), 2000);
 		});
 		RInterface::issueCommand(QStringLiteral("rm(x); rm(y)"), RCommand::User);
+		// some stuff we don't expect to work "accidentally" in a non-utf8 locale
+		// NOTE that we're also checking the string boundaries ([]), just in case R's UTF8-markers on Windows ever pop up, again
+		const auto strings = QStringList() << u"¢Ä"_s << u"€🚚"_s << u"✨☀️"_s;
+		for (const auto &string : strings) {
+			runCommandAsync(new RCommand(u"print(\"%1\"); cat(\"[%1]\")"_s.arg(string), RCommand::App), nullptr, [string](RCommand *command) {
+				QVERIFY(!command->failed());
+				QVERIFY(command->fullOutput().contains(u"\"%1\""_s.arg(string)));
+				QVERIFY(command->fullOutput().contains(u"[%1]"_s.arg(string)));
+			});
+		}
+		waitForAllFinished();
 	}
 
 	void irregularShortNameTest() {
@@ -427,19 +438,6 @@ class RKWardCoreTest : public QObject {
 		QVERIFY(consoleout.value(6).contains(u"fourth"_s));
 	}
 
-	void printUtf8Test() {
-		// some stuff we don't expect to work in native locale
-		const auto strings = QStringList() << u"¢Ä"_s << u"€🚚"_s << u"✨☀️"_s;
-		for (const auto &string : strings) {
-			runCommandAsync(new RCommand(u"print(\"%1\"); cat(paste0(\"[\", \"%1\", \"]\"))"_s.arg(string), RCommand::App), nullptr, [string](RCommand *command) {
-				QVERIFY(!command->failed());
-				QVERIFY(command->fullOutput().contains(u"\"%1\""_s.arg(string)));
-				QVERIFY(command->fullOutput().contains(u"[%1]"_s.arg(string)));
-			});
-		}
-		waitForAllFinished();
-	}
-
 	void cancelCommandStressTest() {
 		int cancelled_commands = 0;
 		int commands_out = 0;



More information about the rkward-tracker mailing list