Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / dolphin / src / tests / renamedialogtest.cpp
blobdc2adffd95f271e8b26c5e347c54f7394e30112d
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "renamedialogtest.h"
21 #include <qtest_kde.h>
22 #include <renamedialog.h>
24 QTEST_KDEMAIN(RenameDialogTest, NoGUI)
26 void RenameDialogTest::testExtensionString()
28 QString result;
30 result = RenameDialog::extensionString("Image.gif");
31 QCOMPARE(result, QString(".gif"));
33 result = RenameDialog::extensionString("package.tar.gz");
34 QCOMPARE(result, QString(".tar.gz"));
36 result = RenameDialog::extensionString("cmake-2.4.5");
37 QCOMPARE(result, QString());
39 result = RenameDialog::extensionString("Image.1.12.gif");
40 QCOMPARE(result, QString(".gif"));
42 result = RenameDialog::extensionString("Image.tar.1.12.gz");
43 QCOMPARE(result, QString(".gz"));
45 result = RenameDialog::extensionString("Open office.org writer documentation.pdf");
46 QCOMPARE(result, QString(".pdf"));
48 result = RenameDialog::extensionString("Test.toolongextension.pdf");
49 QCOMPARE(result, QString(".pdf"));
51 result = RenameDialog::extensionString("Test.x x.pdf");
52 QCOMPARE(result, QString(".pdf"));
55 #include "renamedialogtest.moc"