Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Merged at revision: 2174
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 85 lines (+19/-5)
2 files modified
src/UbuntuToolkit/sortfiltermodel.cpp (+5/-2)
tests/unit/components/tst_sortfiltermodel.qml (+14/-3)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Needs Fixing
Tim Peeters Approve
Adnane Belmadiaf (community) Approve
Review via email: mp+317537@code.launchpad.net

Commit message

Unit test case insensitive FilterBehavior.pattern

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Adnane Belmadiaf (daker) wrote :

LGMT

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

looks good.

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/UbuntuToolkit/sortfiltermodel.cpp'
2--- src/UbuntuToolkit/sortfiltermodel.cpp 2016-09-12 09:03:50 +0000
3+++ src/UbuntuToolkit/sortfiltermodel.cpp 2017-02-21 10:56:46 +0000
4@@ -52,7 +52,8 @@
5 * }
6 * ListElement {
7 * title: "Elephants Dream"
8- * producer: "Blender"
9+ * // lowercase b
10+ * producer: "blender"
11 * }
12 * ListElement {
13 * title: "Big Buck Bunny"
14@@ -69,7 +70,8 @@
15 * sortCaseSensitivity: Qt.CaseInsensitive
16 *
17 * filter.property: "producer"
18- * filter.pattern: /blender/
19+ * // case insensitive matches
20+ * filter.pattern: /blender/i
21 * }
22 *
23 * ListView {
24@@ -154,6 +156,7 @@
25 * \li /possible/ matches anywhere in a word, so both "impossible" and "possible".
26 * \li /^sign/ matches "sign". But not "assignment" because ^ means start.
27 * \li /vest$/ matches "safety vest" and "vest" but not "vested".
28+ * \li /bar/i matches "bar", "Bar" or "BAR" regardless of case.
29 * \endlist
30 *
31 * For more advanced uses it's recommended to read up on Javascript regular expressions.
32
33=== modified file 'tests/unit/components/tst_sortfiltermodel.qml'
34--- tests/unit/components/tst_sortfiltermodel.qml 2015-03-03 13:20:06 +0000
35+++ tests/unit/components/tst_sortfiltermodel.qml 2017-02-21 10:56:46 +0000
36@@ -25,7 +25,7 @@
37 id: things
38 ListElement { foo: "pub"; alpha: "bee"; num: 200 }
39 ListElement { foo: "den"; alpha: "cow"; num: 300 }
40- ListElement { foo: "bar"; alpha: "ant"; num: 100 }
41+ ListElement { foo: "Bar"; alpha: "ant"; num: 100 }
42 }
43
44 SortFilterModel {
45@@ -72,6 +72,13 @@
46 filter.pattern: /e/
47 }
48
49+ SortFilterModel {
50+ id: caseSensitivity
51+ model: things
52+ filter.property: "foo"
53+ filter.pattern: /bar/i
54+ }
55+
56 function test_passthrough() {
57 compare(unmodified.count, things.count)
58 }
59@@ -84,7 +91,7 @@
60 compare(alphabetic.get(2).alpha, "cow")
61
62 // Ensure different columns work also
63- compare(alphaSecond.get(0).foo, "bar")
64+ compare(alphaSecond.get(0).foo, "Bar")
65
66 // Descending
67 compare(alphabeticRe.sort.order, Qt.DescendingOrder)
68@@ -98,7 +105,7 @@
69
70 // Changing roles
71 alphabetic.sort.property = "foo"
72- compare(alphabetic.get(0).foo, "bar")
73+ compare(alphabetic.get(0).foo, "Bar")
74 compare(alphabetic.get(1).foo, "den")
75 compare(alphabetic.get(2).foo, "pub")
76 // Sanity check
77@@ -120,4 +127,8 @@
78 compare(bee.count, 1)
79 compare(bee.get(0).alpha, "bee")
80 }
81+
82+ function test_case_sensitivity() {
83+ compare(caseSensitivity.get(0).foo, "Bar")
84+ }
85 }

Subscribers

People subscribed via source and target branches