SQLite

Check-in [65e5f7706d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update some test cases in fts4aa.test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 65e5f7706d3b6784f9cce315478d7623d6d7e7d9
User & Date: dan 2011-06-20 12:24:26.051
Context
2011-06-20
15:24
Enable crnl to nl translation for the mksqlite3c.tcl script. (check-in: 161379d205 user: drh tags: trunk)
12:24
Update some test cases in fts4aa.test. (check-in: 65e5f7706d user: dan tags: trunk)
11:15
Fix a problem where FTS test code was not being included in the testfixture build when SQLITE_ENABLE_FTS4 was defined. (check-in: e539d08a4d user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/fts4aa.test.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
source $testdir/tester.tcl

# If SQLITE_ENABLE_FTS3 is defined, omit this file.
ifcapable !fts3 {
  finish_test
  return
}
if {[db eval {SELECT sqlite_compileoption_used('ENABLE_FTS4')}]==0} {
  finish_test
  return
}

do_test fts4aa-1.0 {
db eval {
CREATE VIRTUAL TABLE t1 USING fts4(words, tokenize porter);
BEGIN TRANSACTION;
INSERT INTO t1(docid,words) VALUES(1001001,'In the beginning God created the heaven and the earth.');
INSERT INTO t1(docid,words) VALUES(1001002,'And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.');







<
<
<
<







17
18
19
20
21
22
23




24
25
26
27
28
29
30
source $testdir/tester.tcl

# If SQLITE_ENABLE_FTS3 is defined, omit this file.
ifcapable !fts3 {
  finish_test
  return
}





do_test fts4aa-1.0 {
db eval {
CREATE VIRTUAL TABLE t1 USING fts4(words, tokenize porter);
BEGIN TRANSACTION;
INSERT INTO t1(docid,words) VALUES(1001001,'In the beginning God created the heaven and the earth.');
INSERT INTO t1(docid,words) VALUES(1001002,'And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.');
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628

1629
1630
1631
1632
1633
1634
1635
1636
  binary scan $blob $scan($::tcl_platform(byteOrder)) r
  return $r
}
db func mit mit

do_test fts4aa-2.1 {
  db eval {
    SELECT docid, mit(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'melchizedek';
  }
} {1014018 {1 1 1 1 1 1533 25 20}}
do_test fts4aa-2.2 {
  db eval {
    SELECT docid, mit(matchinfo(t1)) FROM t1
     WHERE t1 MATCH 'spake hebrew'
     ORDER BY docid;
  }
} {1039014 {2 1 1 40 40 1 6 6 1533 25 42} 1039017 {2 1 1 40 40 1 6 6 1533 25 26}}
do_test fts4aa-2.3 {
  db eval {
    SELECT docid, mit(matchinfo(t1)) FROM t1
     WHERE t1 MATCH 'laban overtook jacob'
     ORDER BY docid;
  }
} {1031025 {3 1 2 54 46 1 3 3 2 181 160 1533 25 24}}

do_test fts4aa-9.1 {
  db eval {
    DELETE FROM t1 WHERE docid!=1050026;
    SELECT hex(size) FROM t1_docsize;
    SELECT hex(value) FROM t1_stat;
  }
} {17 0117}

do_test fts4aa-9.2 {
  db eval {
    SELECT docid FROM t1 EXCEPT SELECT docid FROM t1_docsize
  }
} {}
do_test fts4aa-9.3 {
  db eval {
    SELECT docid FROM t1_docsize EXCEPT SELECT docid FROM t1
  }
} {}
do_test fts4aa-9.4 {

  db eval {
    SELECT docid, mit(matchinfo(t1)) FROM t1
     WHERE t1 MATCH 'joseph died in egypt'
     ORDER BY docid;
  }
} {1050026 {4 1 1 1 1 1 1 1 2 2 1 1 1 1 1 23 23}}

finish_test







|




|






|











|












>

|



|


1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
  binary scan $blob $scan($::tcl_platform(byteOrder)) r
  return $r
}
db func mit mit

do_test fts4aa-2.1 {
  db eval {
    SELECT docid, mit(matchinfo(t1, 'pcxnal')) FROM t1 WHERE t1 MATCH 'melchizedek';
  }
} {1014018 {1 1 1 1 1 1533 25 20}}
do_test fts4aa-2.2 {
  db eval {
    SELECT docid, mit(matchinfo(t1, 'pcxnal')) FROM t1
     WHERE t1 MATCH 'spake hebrew'
     ORDER BY docid;
  }
} {1039014 {2 1 1 40 40 1 6 6 1533 25 42} 1039017 {2 1 1 40 40 1 6 6 1533 25 26}}
do_test fts4aa-2.3 {
  db eval {
    SELECT docid, mit(matchinfo(t1, 'pcxnal')) FROM t1
     WHERE t1 MATCH 'laban overtook jacob'
     ORDER BY docid;
  }
} {1031025 {3 1 2 54 46 1 3 3 2 181 160 1533 25 24}}

do_test fts4aa-9.1 {
  db eval {
    DELETE FROM t1 WHERE docid!=1050026;
    SELECT hex(size) FROM t1_docsize;
    SELECT hex(value) FROM t1_stat;
  }
} {17 01176F}

do_test fts4aa-9.2 {
  db eval {
    SELECT docid FROM t1 EXCEPT SELECT docid FROM t1_docsize
  }
} {}
do_test fts4aa-9.3 {
  db eval {
    SELECT docid FROM t1_docsize EXCEPT SELECT docid FROM t1
  }
} {}
do_test fts4aa-9.4 {
  # Note: Token 'in' is being deferred in the following query. 
  db eval {
    SELECT docid, mit(matchinfo(t1, 'pcxnal')) FROM t1
     WHERE t1 MATCH 'joseph died in egypt'
     ORDER BY docid;
  }
} {1050026 {4 1 1 1 1 1 1 1 2 1 1 1 1 1 1 23 23}}

finish_test