summaryrefslogtreecommitdiffstats
path: root/tests/auto/qkeysequence
diff options
context:
space:
mode:
authorChani Armitage <chanika@gmail.com>2009-12-02 17:56:40 +0100
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-12-02 17:56:40 +0100
commit0fc7c731b47d7984ab8039f70561ad559a0bd36d (patch)
treef1742ce73d82e63fb7605c71c5464e6f56765df6 /tests/auto/qkeysequence
parentae0c72025c78e4fa4f8aa793e3b83f245a7837a7 (diff)
fix QKeySequence::fromString
now emacs-style shortcuts are parsed correctly, like in the constructor, and they share the code too. Merge-request: 1279 Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Diffstat (limited to 'tests/auto/qkeysequence')
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index bc9ae6cc47..a299d54730 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -119,6 +119,7 @@ private slots:
void symetricConstructors_data();
void symetricConstructors();
void checkMultipleNames();
+ void checkMultipleCodes();
void mnemonic_data();
void mnemonic();
void toString_data();
@@ -265,6 +266,18 @@ void tst_QKeySequence::checkMultipleNames()
QVERIFY( oldK == newK );
}
+//TODO: could test third constructor, or test fromString on all constructor-data
+void tst_QKeySequence::checkMultipleCodes()
+{
+ QKeySequence seq1("Alt+d, l");
+ QKeySequence seq2 = QKeySequence::fromString("Alt+d, l");
+ QVERIFY( seq1 == seq2 );
+
+ QKeySequence seq3("Alt+d,l");
+ QKeySequence seq4 = QKeySequence::fromString("Alt+d,l");
+ QVERIFY( seq3 == seq4 );
+}
+
/*
* We must ensure that the keyBindings data is allways sorted
* so that we can safely perform binary searches.