diff options
author | thez3ro <io@thezero.org> | 2018-03-06 01:32:04 +0300 |
---|---|---|
committer | TheZ3ro <io@thezero.org> | 2018-03-06 17:56:27 +0300 |
commit | 10170a555e0200640dfc7577db05811b7f4388b8 (patch) | |
tree | ffa2622873ac52b50e26239797c4a47482951844 /tests/TestEntry.cpp | |
parent | 18628612b243a2f699a18291735b03e356b12375 (diff) |
add test case for recursive placeholders
Diffstat (limited to 'tests/TestEntry.cpp')
-rw-r--r-- | tests/TestEntry.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/TestEntry.cpp b/tests/TestEntry.cpp index 94100c0a6..c088fc01f 100644 --- a/tests/TestEntry.cpp +++ b/tests/TestEntry.cpp @@ -279,6 +279,17 @@ void TestEntry::testResolveRecursivePlaceholders() QCOMPARE(entry6->resolvePlaceholder(entry6->title()), QString("Entry2Title")); QCOMPARE(entry6->resolvePlaceholder(entry6->username()), QString("Entry2Title")); QCOMPARE(entry6->resolvePlaceholder(entry6->password()), QString("{PASSWORD}")); + + auto* entry7 = new Entry(); + entry7->setGroup(root); + entry7->setUuid(Uuid::random()); + entry7->setTitle(QString("{REF:T@I:%1} and something else").arg(entry3->uuid().toHex())); + entry7->setUsername(QString("{TITLE}")); + entry7->setPassword(QString("PASSWORD")); + + QCOMPARE(entry7->resolvePlaceholder(entry7->title()), QString("Entry2Title and something else")); + QCOMPARE(entry7->resolvePlaceholder(entry7->username()), QString("Entry2Title and something else")); + QCOMPARE(entry7->resolvePlaceholder(entry7->password()), QString("PASSWORD")); } void TestEntry::testResolveReferencePlaceholders() |