← Back to team overview

ubuntu-sdk-team team mailing list archive

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

 

Christian Dywan has proposed merging lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern into lp:ubuntu-ui-toolkit/staging.

Commit message:
Unit test case insensitive FilterBehavior.pattern

Requested reviews:
  Ubuntu SDK team (ubuntu-sdk-team)
Related bugs:
  Bug #1663924 in ubuntu-ui-toolkit (Ubuntu): "filterCaseSensitivity doesn't work when used in SortFilterModel"
  https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1663924

For more details, see:
https://code.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern/+merge/317537
-- 
Your team Ubuntu SDK team is requested to review the proposed merge of lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern into lp:ubuntu-ui-toolkit/staging.
=== modified file 'tests/unit/components/tst_sortfiltermodel.qml'
--- tests/unit/components/tst_sortfiltermodel.qml	2015-03-03 13:20:06 +0000
+++ tests/unit/components/tst_sortfiltermodel.qml	2017-02-16 18:42:34 +0000
@@ -25,7 +25,7 @@
         id: things
         ListElement { foo: "pub"; alpha: "bee"; num: 200 }
         ListElement { foo: "den"; alpha: "cow"; num: 300 }
-        ListElement { foo: "bar"; alpha: "ant"; num: 100 }
+        ListElement { foo: "Bar"; alpha: "ant"; num: 100 }
     }
 
     SortFilterModel {
@@ -72,6 +72,13 @@
         filter.pattern: /e/
     }
 
+    SortFilterModel {
+        id: caseSensitivity
+        model: things
+        filter.property: "foo"
+        filter.pattern: /bar/i
+    }
+
     function test_passthrough() {
         compare(unmodified.count, things.count)
     }
@@ -84,7 +91,7 @@
         compare(alphabetic.get(2).alpha, "cow")
 
         // Ensure different columns work also
-        compare(alphaSecond.get(0).foo, "bar")
+        compare(alphaSecond.get(0).foo, "Bar")
 
         // Descending
         compare(alphabeticRe.sort.order, Qt.DescendingOrder)
@@ -98,7 +105,7 @@
 
         // Changing roles
         alphabetic.sort.property = "foo"
-        compare(alphabetic.get(0).foo, "bar")
+        compare(alphabetic.get(0).foo, "Bar")
         compare(alphabetic.get(1).foo, "den")
         compare(alphabetic.get(2).foo, "pub")
         // Sanity check
@@ -120,4 +127,8 @@
         compare(bee.count, 1)
         compare(bee.get(0).alpha, "bee")
     }
+
+    function test_case_sensitivity() {
+        compare(caseSensitivity.get(0).foo, "Bar")
+    }
 }


Follow ups