Welcome to mirror list, hosted at ThFree Co, Russian Federation.

testfolder.h « test - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 786f798fca6d6b93312b88a2fa28ab8b647056cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 *    This software is in the public domain, furnished "as is", without technical
 *    support, and with no warranty, express or implied, as to its usefulness for
 *    any purpose.
 *
 */

#ifndef MIRALL_TESTFOLDER_H
#define MIRALL_TESTFOLDER_H

#include <QtTest>

#include "utility.h"
#include "folder.h"

using namespace OCC;

class TestFolder: public QObject
{
    Q_OBJECT
private slots:
    void testFolder()
    {
        QFETCH(QString, folder);
        QFETCH(QString, expectedFolder);
        Folder *f = new Folder("alias", folder, "http://foo.bar.net");
        QCOMPARE(f->path(), expectedFolder);
        delete f;
    }

    void testFolder_data()
    {
        QTest::addColumn<QString>("folder");
        QTest::addColumn<QString>("expectedFolder");

        QTest::newRow("unixcase") << "/foo/bar" << "/foo/bar";
        QTest::newRow("doubleslash") << "/foo//bar" << "/foo/bar";
        QTest::newRow("tripleslash") << "/foo///bar" << "/foo/bar";
        QTest::newRow("mixedslash") << "/foo/\\bar" << "/foo/bar";
        QTest::newRow("windowsfwslash") << "C:/foo/bar" << "C:/foo/bar";
        QTest::newRow("windowsbwslash") << "C:\\foo" << "C:/foo";
        QTest::newRow("windowsbwslash2") << "C:\\foo\\bar" << "C:/foo/bar";
    }

};

#endif