summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAdriano Melo <adriano.melo@openbossa.org>2012-04-26 15:42:51 -0300
committerLuis Gabriel Lima <luis.gabriel@openbossa.org>2012-04-27 22:24:38 +0200
commitd1dc0e8bbb60adf03aaffe9aa4018937a6503bfa (patch)
treec1b4a9ff3fb0dad76ce477df8de9ce1e9575c3bd /tests
parent338a7f33e631376887a9f131eed945a6faf3b330 (diff)
UiTextFileModel separator now is a regular expression
- Separator property changed from QString to QRegExp - CaseSensitivity property added - QML UiTextFileModel example modified to use a regular expression Change-Id: I36e288ea87955c219bac1872ffde2fca17eb65fa Reviewed-by: Daker Fernandes Pinheiro <daker.pinheiro@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/models/uitextfilemodel/tst_uitextfilemodel.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/models/uitextfilemodel/tst_uitextfilemodel.cpp b/tests/auto/models/uitextfilemodel/tst_uitextfilemodel.cpp
index 4bd3e46..482f05e 100644
--- a/tests/auto/models/uitextfilemodel/tst_uitextfilemodel.cpp
+++ b/tests/auto/models/uitextfilemodel/tst_uitextfilemodel.cpp
@@ -63,6 +63,8 @@ private slots:
void carriageReturnLineFeedSeparatorCount();
void specialCharacterSeparatorCount();
void withoutSeparatorCount();
+ void regexpSimpleCount();
+ void regexpLineBeginnigCount();
};
void tst_UiTextFileModel::init()
@@ -130,5 +132,21 @@ void tst_UiTextFileModel::withoutSeparatorCount()
QCOMPARE(model.rowCount(), rowsCount + 1);
}
+void tst_UiTextFileModel::regexpSimpleCount()
+{
+ UiHelpers::UiTextFileModel model;
+ model.setSeparator("[\n\r]");
+ model.setSource(file.fileName());
+ QCOMPARE(model.rowCount(), rowsCount + 1);
+}
+
+void tst_UiTextFileModel::regexpLineBeginnigCount()
+{
+ UiHelpers::UiTextFileModel model;
+ model.setSeparator("(Come)");
+ model.setSource(file.fileName());
+ QCOMPARE(model.rowCount(), rowsCount + 1);
+}
+
QTEST_MAIN(tst_UiTextFileModel)
#include "tst_uitextfilemodel.moc"