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

Side by Side Diff: third_party/sqlite/src/test/fts3malloc.test

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 # 2009 October 22 1 # 2009 October 22
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 do_write_test fts3_malloc-1.4 sqlite_master { 56 do_write_test fts3_malloc-1.4 sqlite_master {
57 CREATE VIRTUAL TABLE ft4 USING fts3(`a`, 'fred''s column'); 57 CREATE VIRTUAL TABLE ft4 USING fts3(`a`, 'fred''s column');
58 } 58 }
59 do_error_test fts3_malloc-1.5 { 59 do_error_test fts3_malloc-1.5 {
60 CREATE VIRTUAL TABLE ft5 USING fts3(a, b, tokenize unknown) 60 CREATE VIRTUAL TABLE ft5 USING fts3(a, b, tokenize unknown)
61 } {unknown tokenizer: unknown} 61 } {unknown tokenizer: unknown}
62 do_write_test fts3_malloc-1.6 sqlite_master { 62 do_write_test fts3_malloc-1.6 sqlite_master {
63 CREATE VIRTUAL TABLE ft6 USING fts3(a, b, tokenize porter) 63 CREATE VIRTUAL TABLE ft6 USING fts3(a, b, tokenize porter)
64 } 64 }
65 do_write_test fts3_malloc-1.7 sqlite_master {
66 CREATE VIRTUAL TABLE ft7 USING fts4(a, b, notindexed=b)
67 }
65 68
66 # Test the xConnect/xDisconnect methods: 69 # Test the xConnect/xDisconnect methods:
67 #db eval { ATTACH 'test2.db' AS aux } 70 #db eval { ATTACH 'test2.db' AS aux }
68 #do_write_test fts3_malloc-1.6 aux.sqlite_master { 71 #do_write_test fts3_malloc-1.6 aux.sqlite_master {
69 # CREATE VIRTUAL TABLE aux.ft7 USING fts3(a, b, c); 72 # CREATE VIRTUAL TABLE aux.ft7 USING fts3(a, b, c);
70 #} 73 #}
71 #do_write_test fts3_malloc-1.6 aux.sqlite_master { 74 #do_write_test fts3_malloc-1.6 aux.sqlite_master {
72 # CREATE VIRTUAL TABLE aux.ft7 USING fts3(a, b, c); 75 # CREATE VIRTUAL TABLE aux.ft7 USING fts3(a, b, c);
73 #} 76 #}
74 77
75 78
76 79
77 do_test fts3_malloc-2.0 { 80 do_test fts3_malloc-2.0 {
78 execsql { 81 execsql {
79 DROP TABLE ft1; 82 DROP TABLE ft1;
80 DROP TABLE ft2; 83 DROP TABLE ft2;
81 DROP TABLE ft3; 84 DROP TABLE ft3;
82 DROP TABLE ft4; 85 DROP TABLE ft4;
83 DROP TABLE ft6; 86 DROP TABLE ft6;
87 DROP TABLE ft7;
84 } 88 }
85 execsql { CREATE VIRTUAL TABLE ft USING fts3(a, b) } 89 execsql { CREATE VIRTUAL TABLE ft USING fts3(a, b) }
86 for {set ii 1} {$ii < 32} {incr ii} { 90 for {set ii 1} {$ii < 32} {incr ii} {
87 set a [list] 91 set a [list]
88 set b [list] 92 set b [list]
89 if {$ii & 0x01} {lappend a one ; lappend b neung} 93 if {$ii & 0x01} {lappend a one ; lappend b neung}
90 if {$ii & 0x02} {lappend a two ; lappend b song } 94 if {$ii & 0x02} {lappend a two ; lappend b song }
91 if {$ii & 0x04} {lappend a three ; lappend b sahm } 95 if {$ii & 0x04} {lappend a three ; lappend b sahm }
92 if {$ii & 0x08} {lappend a four ; lappend b see } 96 if {$ii & 0x08} {lappend a four ; lappend b see }
93 if {$ii & 0x10} {lappend a five ; lappend b hah } 97 if {$ii & 0x10} {lappend a five ; lappend b hah }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 do_test fts3_malloc-4.2 { 291 do_test fts3_malloc-4.2 {
288 execsql { SELECT a FROM ft } 292 execsql { SELECT a FROM ft }
289 } {two four {two four}} 293 } {two four {two four}}
290 294
291 do_write_test fts3_malloc-5.1 ft_content { 295 do_write_test fts3_malloc-5.1 ft_content {
292 INSERT INTO ft VALUES('short alongertoken reallyquitealotlongerimeanit andthis tokenisjustsolongthatonemightbeforgivenforimaginingthatitwasmerelyacontrivedexam pleandnotarealtoken', 'cynics!') 296 INSERT INTO ft VALUES('short alongertoken reallyquitealotlongerimeanit andthis tokenisjustsolongthatonemightbeforgivenforimaginingthatitwasmerelyacontrivedexam pleandnotarealtoken', 'cynics!')
293 } 297 }
294 do_test fts3_malloc-5.2 { 298 do_test fts3_malloc-5.2 {
295 execsql { CREATE VIRTUAL TABLE ft8 USING fts3(x, tokenize porter) } 299 execsql { CREATE VIRTUAL TABLE ft8 USING fts3(x, tokenize porter) }
296 } {} 300 } {}
301
297 do_write_test fts3_malloc-5.3 ft_content { 302 do_write_test fts3_malloc-5.3 ft_content {
298 INSERT INTO ft8 VALUES('short alongertoken reallyquitealotlongerimeanit andthi stokenisjustsolongthatonemightbeforgivenforimaginingthatitwasmerelyacontrivedexa mpleandnotarealtoken') 303 INSERT INTO ft8 VALUES('short alongertoken reallyquitealotlongerimeanit andthi stokenisjustsolongthatonemightbeforgivenforimaginingthatitwasmerelyacontrivedexa mpleandnotarealtoken')
299 } 304 }
300 305
301 306
302 finish_test 307 finish_test
303
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698