summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lupdate/testdata/good/merge_whitespace
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/linguist/lupdate/testdata/good/merge_whitespace')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_whitespace/main.cpp23
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro14
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.before70
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.result71
4 files changed, 178 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/main.cpp b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/main.cpp
new file mode 100644
index 0000000..e058da0
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/main.cpp
@@ -0,0 +1,23 @@
+#include <QApplication>
+#include <QDebug>
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QTranslator translator;
+ translator.load("whitespace");
+ app.installTranslator(&translator);
+
+ QObject::tr("\nnewline at the start");
+ QObject::tr("newline at the end\n");
+ QObject::tr("newline and space at the end\n ");
+ QObject::tr("space and newline at the end \n");
+ QObject::tr("\tTab at the start and newline at the end\n");
+ QObject::tr("\n\tnewline and tab at the start");
+ QObject::tr(" \tspace and tab at the start");
+ QObject::tr(" space_first");
+ QObject::tr("space_last ");
+ QObject::tr("carriage return and line feed last\r\n");
+ return app.exec();
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro
new file mode 100644
index 0000000..f4faf2f
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+SOURCES = main.cpp
+
+TRANSLATIONS = project.ts
+
+# Copy the ts to a temp file because:
+# 1. The depot file is usually read-only
+# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
+# without reverting the original file again.
+
+win32: system(copy /Y project.ts.before $$TRANSLATIONS)
+unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.before
new file mode 100644
index 0000000..3acae3e
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.before
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1">
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="7"/>
+ <source>
+newline at the start</source>
+ <translation>
+NEWLINE AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="8"/>
+ <source>newline at the end
+</source>
+ <translation>NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="9"/>
+ <source>newline and space at the end
+ </source>
+ <translation>NEWLINE AND SPACE AT THE END
+ </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="10"/>
+ <source>space and newline at the end
+</source>
+ <translation>SPACE AND NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="11"/>
+ <source><byte value="x9"/>Tab at the start and newline at the end
+</source>
+ <translation><byte value="x9"/>TAB AT THE START AND NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="12"/>
+ <source>
+<byte value="x9"/>newline and tab at the start</source>
+ <translation>
+<byte value="x9"/>NEWLINE AND TAB AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="13"/>
+ <source> <byte value="x9"/>space and tab at the start</source>
+ <translation> <byte value="x9"/>SPACE AND TAB AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="14"/>
+ <source> space_first</source>
+ <translation> SPACE_FIRST</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="15"/>
+ <source>space_last </source>
+ <translation>SPACE_LAST </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="21"/>
+ <source>carriage return and line feed last<byte value="xd"/>
+</source>
+ <translation type="unfinished">CARRIAGE RETURN AND LINE FEED LAST<byte value="xd"/>
+</translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.result
new file mode 100644
index 0000000..6d6b469
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.ts.result
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="12"/>
+ <source>
+newline at the start</source>
+ <translation>
+NEWLINE AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="13"/>
+ <source>newline at the end
+</source>
+ <translation>NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="14"/>
+ <source>newline and space at the end
+ </source>
+ <translation>NEWLINE AND SPACE AT THE END
+ </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="15"/>
+ <source>space and newline at the end
+</source>
+ <translation>SPACE AND NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="16"/>
+ <source> Tab at the start and newline at the end
+</source>
+ <translation> TAB AT THE START AND NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="17"/>
+ <source>
+ newline and tab at the start</source>
+ <translation>
+ NEWLINE AND TAB AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="18"/>
+ <source> space and tab at the start</source>
+ <translation> SPACE AND TAB AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="19"/>
+ <source> space_first</source>
+ <translation> SPACE_FIRST</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="20"/>
+ <source>space_last </source>
+ <translation>SPACE_LAST </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="21"/>
+ <source>carriage return and line feed last
+</source>
+ <translation type="unfinished">CARRIAGE RETURN AND LINE FEED LAST
+</translation>
+ </message>
+</context>
+</TS>