[evolution-data-server/sqlite-refactor: 11/17] test-client-custom-summary: Added test for the underscore



commit a1ad1c228c96c87364ed3f070da88ca4d20e32ff
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Sat Nov 23 22:36:18 2013 +0900

    test-client-custom-summary: Added test for the underscore
    
    Before we used to only escape the '%' character in LIKE statements,
    but SQLite also recognizes the '_' as a single char wildcard and
    needs escaping.
    
    This test ensures that the underscore is properly handled.

 tests/libebook/client/test-client-custom-summary.c |   13 +++++++++++++
 tests/libebook/data/vcards/custom-6.vcf            |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/tests/libebook/client/test-client-custom-summary.c 
b/tests/libebook/client/test-client-custom-summary.c
index 7f39e6d..386e5a1 100644
--- a/tests/libebook/client/test-client-custom-summary.c
+++ b/tests/libebook/client/test-client-custom-summary.c
@@ -407,6 +407,19 @@ main (gint argc,
                        suites[i].custom,
                        FALSE);
 
+               add_client_test (
+                       suites[i].prefix,
+                       "/Prefix/FullName/Underscore",
+                       suites[i].func,
+                       e_book_query_field_test (
+                               E_CONTACT_FULL_NAME,
+                               E_BOOK_QUERY_CONTAINS,
+                               "ran_ge"),
+                       1,
+                       suites[i].direct,
+                       suites[i].custom,
+                       FALSE);
+
                /* Query the E_CONTACT_TEL field for something that is not a
                 * phone number, user is searching for all the contacts when
                 * they noted they must ask Jenny for the phone number. */
diff --git a/tests/libebook/data/vcards/custom-6.vcf b/tests/libebook/data/vcards/custom-6.vcf
index 03f7767..a43da5e 100644
--- a/tests/libebook/data/vcards/custom-6.vcf
+++ b/tests/libebook/data/vcards/custom-6.vcf
@@ -1,5 +1,5 @@
 BEGIN:VCARD
 UID:custom-6
 TEL;HOME:ask Jenny for Lisa's number
-FN:%Strange Name
+FN:%Stran_ge Name
 END:VCARD


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]