diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2016-04-20 18:46:53 +0300 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2016-04-21 13:46:03 +0300 |
commit | e29d7e012817da10362673e59c440cd2e2dc8e8d (patch) | |
tree | 08d5fd335e5ba3c49a36f63605df7f8ec439e150 /test | |
parent | f9fb7a59dd6173e820b9704a63248488bb0ee08b (diff) |
Use QTokenizer to properly parse netrc
Addresses #4691
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/testnetrcparser.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 928e8bce8..cf3f0a78c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,7 @@ include_directories(${CMAKE_BINARY_DIR}/csync ${CMAKE_BINARY_DIR}/csync/src ${CMAKE_BINARY_DIR}/src) include_directories(${CMAKE_SOURCE_DIR}/csync/src/) include_directories(${CMAKE_SOURCE_DIR}/csync/src/std ${CMAKE_SOURCE_DIR}/src) +include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer) include(QtVersionAbstraction) setup_qt() diff --git a/test/testnetrcparser.cpp b/test/testnetrcparser.cpp index 2bb66833e..ae3222736 100644 --- a/test/testnetrcparser.cpp +++ b/test/testnetrcparser.cpp @@ -29,6 +29,7 @@ private slots: netrc.write("machine foo login bar password baz\n"); netrc.write("machine broken login bar2 dontbelonghere password baz2 extratokens dontcare andanother\n"); netrc.write("machine\nfunnysplit\tlogin bar3 password baz3\n"); + netrc.write("machine frob login \"user with spaces\" password 'space pwd'\n"); QFile netrcWithDefault(testfileWithDefaultC); QVERIFY(netrcWithDefault.open(QIODevice::WriteOnly)); netrcWithDefault.write("machine foo login bar password baz\n"); @@ -47,8 +48,9 @@ private slots: NetrcParser parser(testfileC); QVERIFY(parser.parse()); QCOMPARE(parser.find("foo"), qMakePair(QString("bar"), QString("baz"))); - QCOMPARE(parser.find("broken"), qMakePair(QString("bar2"), QString("baz2"))); + QCOMPARE(parser.find("broken"), qMakePair(QString("bar2"), QString())); QCOMPARE(parser.find("funnysplit"), qMakePair(QString("bar3"), QString("baz3"))); + QCOMPARE(parser.find("frob"), qMakePair(QString("user with spaces"), QString("space pwd"))); } void testEmptyNetrc() { |