Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: third_party/sqlite/src/test/collate8.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/collate4.test ('k') | third_party/sqlite/src/test/colmeta.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/collate8.test
diff --git a/third_party/sqlite/src/test/collate8.test b/third_party/sqlite/src/test/collate8.test
index 60a89162dddd6a569273b1430ab19a40dc5e60e8..b06c87d2f88ec94ac363361026391381eb190c87 100644
--- a/third_party/sqlite/src/test/collate8.test
+++ b/third_party/sqlite/src/test/collate8.test
@@ -13,7 +13,9 @@
# focus of this script is making sure collations pass through the
# unary + operator.
#
-# $Id: collate8.test,v 1.2 2008/08/25 12:14:09 drh Exp $
+# 2015-02-09: Added tests to make sure COLLATE passes through function
+# calls. Ticket [ca0d20b6cdddec5e81b8d66f89c46a5583b5f6f6].
+#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -122,4 +124,34 @@ do_test collate8-2.8 {
}
} {abc}
+# Make sure the COLLATE operator perculates up through function calls
+# and other Expr structures that use the Expr.x.pList field.
+#
+do_execsql_test collate8-3.1 {
+ SELECT 'abc'==('ABC'||'') COLLATE nocase;
+ SELECT 'abc'==('ABC'||'' COLLATE nocase);
+ SELECT 'abc'==('ABC'||('' COLLATE nocase));
+ SELECT 'abc'==('ABC'||upper('' COLLATE nocase));
+} {1 1 1 1}
+do_execsql_test collate8-3.2 {
+ SELECT 'abc'==('ABC'||max('' COLLATE nocase,'' COLLATE binary));
+} {1}
+
+# The COLLATE binary is on the left and so takes precedence
+do_execsql_test collate8-3.3 {
+ SELECT 'abc'==('ABC'||max('' COLLATE binary,'' COLLATE nocase));
+} {0}
+
+do_execsql_test collate8-3.4 {
+ SELECT 'abc'==('ABC'||CASE WHEN 1-1=2 THEN '' COLLATE nocase
+ ELSE '' COLLATE binary END);
+ SELECT 'abc'==('ABC'||CASE WHEN 1+1=2 THEN '' COLLATE nocase
+ ELSE '' COLLATE binary END);
+} {1 1}
+do_execsql_test collate8-3.5 {
+ SELECT 'abc'==('ABC'||CASE WHEN 1=2 THEN '' COLLATE binary
+ ELSE '' COLLATE nocase END);
+} {0}
+
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/collate4.test ('k') | third_party/sqlite/src/test/colmeta.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698