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.cpp64
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro3
-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, 208 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 000000000..fb12bc0d9
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#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 000000000..759bea068
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro
@@ -0,0 +1,3 @@
+SOURCES = main.cpp
+
+TRANSLATIONS = project.ts
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 000000000..0f84fedb8
--- /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="49"/>
+ <source>newline at the end
+</source>
+ <translation>NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="50"/>
+ <source>newline and space at the end
+ </source>
+ <translation>NEWLINE AND SPACE AT THE END
+ </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="51"/>
+ <source>space and newline at the end
+</source>
+ <translation>SPACE AND NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="52"/>
+ <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="53"/>
+ <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="54"/>
+ <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="55"/>
+ <source> space_first</source>
+ <translation> SPACE_FIRST</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>space_last </source>
+ <translation>SPACE_LAST </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="62"/>
+ <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 000000000..776238db8
--- /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="53"/>
+ <source>
+newline at the start</source>
+ <translation>
+NEWLINE AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="54"/>
+ <source>newline at the end
+</source>
+ <translation>NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="55"/>
+ <source>newline and space at the end
+ </source>
+ <translation>NEWLINE AND SPACE AT THE END
+ </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>space and newline at the end
+</source>
+ <translation>SPACE AND NEWLINE AT THE END
+</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="57"/>
+ <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="58"/>
+ <source>
+ newline and tab at the start</source>
+ <translation>
+ NEWLINE AND TAB AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="59"/>
+ <source> space and tab at the start</source>
+ <translation> SPACE AND TAB AT THE START</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="60"/>
+ <source> space_first</source>
+ <translation> SPACE_FIRST</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="61"/>
+ <source>space_last </source>
+ <translation>SPACE_LAST </translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="62"/>
+ <source>carriage return and line feed last
+</source>
+ <translation type="unfinished">CARRIAGE RETURN AND LINE FEED LAST
+</translation>
+ </message>
+</context>
+</TS>