Changeset View
Changeset View
Standalone View
Standalone View
addons/project/autotests/test1.cpp
Show All 14 Lines | |||||
15 | * You should have received a copy of the GNU Library General Public License | 15 | * You should have received a copy of the GNU Library General Public License | ||
16 | * along with this library; see the file COPYING.LIB. If not, write to | 16 | * along with this library; see the file COPYING.LIB. If not, write to | ||
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "test1.h" | 21 | #include "test1.h" | ||
22 | #include "fileutil.h" | 22 | #include "fileutil.h" | ||
23 | #include "tools/kateprojectcodeanalysistoolshellcheck.h" | ||||
23 | 24 | | |||
24 | #include <QtTest> | 25 | #include <QtTest> | ||
25 | 26 | | |||
27 | #include <QStringLiteral> | ||||
rjvbbUnsubmitted Not Done rjvbb: ```
addons/project/autotests/test1.cpp:27:10: fatal error: 'QStringLiteral' file not found… | |||||
28 | | ||||
26 | QTEST_MAIN(Test1) | 29 | QTEST_MAIN(Test1) | ||
27 | 30 | | |||
28 | void Test1::initTestCase() | 31 | void Test1::initTestCase() | ||
29 | { | 32 | { | ||
30 | } | 33 | } | ||
31 | 34 | | |||
32 | void Test1::cleanupTestCase() | 35 | void Test1::cleanupTestCase() | ||
33 | { | 36 | { | ||
34 | } | 37 | } | ||
35 | 38 | | |||
36 | void Test1::testCommonParent() | 39 | void Test1::testCommonParent() | ||
37 | { | 40 | { | ||
38 | QCOMPARE(FileUtil::commonParent(QLatin1String("/usr/local/bin"), QLatin1String("/usr/local/bin")), QLatin1String("/usr/local/")); | 41 | QCOMPARE(FileUtil::commonParent(QLatin1String("/usr/local/bin"), QLatin1String("/usr/local/bin")), QLatin1String("/usr/local/")); | ||
39 | QCOMPARE(FileUtil::commonParent(QLatin1String("/usr/local"), QLatin1String("/usr/local/bin")), QLatin1String("/usr/")); | 42 | QCOMPARE(FileUtil::commonParent(QLatin1String("/usr/local"), QLatin1String("/usr/local/bin")), QLatin1String("/usr/")); | ||
40 | QCOMPARE(FileUtil::commonParent(QLatin1String("~/dev/proj1"), QLatin1String("~/dev/proj222")), QLatin1String("~/dev/")); | 43 | QCOMPARE(FileUtil::commonParent(QLatin1String("~/dev/proj1"), QLatin1String("~/dev/proj222")), QLatin1String("~/dev/")); | ||
41 | } | 44 | } | ||
42 | 45 | | |||
46 | void Test1::testShellCheckParsing() | ||||
47 | { | ||||
48 | QString line = QStringLiteral("script.sh:3:11: note: Use ./*glob* or -- *glob* so ... options. [SC2035]"); | ||||
49 | KateProjectCodeAnalysisToolShellcheck sc(nullptr); | ||||
50 | QStringList outList = sc.parseLine(line); | ||||
51 | //qDebug() << outList; | ||||
52 | QCOMPARE(outList.size(), 4); | ||||
53 | } | ||||
54 | | ||||
43 | // kate: space-indent on; indent-width 4; replace-tabs on; | 55 | // kate: space-indent on; indent-width 4; replace-tabs on; |