Skip to content

Commit

Permalink
Add test for fts5 tokenizer support
Browse files Browse the repository at this point in the history
(cherry picked from commit cb2f8bc7cb56d48c43619314b06fc9a675efb2fa)
  • Loading branch information
reflog authored and anacrolix committed Feb 8, 2024
1 parent 3ba4762 commit ca6dc89
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sqlite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -886,3 +886,19 @@ func TestReturningClause(t *testing.T) {
t.Fatalf("want returned fruit id to be 1, got %d", id)
}
}

func TestVirtualTableWithTokenizer(t *testing.T) {
c, err := sqlite.OpenConn(":memory:", 0)
if err != nil {
t.Fatal(err)
}
defer func() {
if err := c.Close(); err != nil {
t.Error(err)
}
}()
stmt := c.Prep(`CREATE VIRTUAL TABLE IF NOT EXISTS fts_table USING fts5(text, tokenize = 'porter trigram')`)
if _, err := stmt.Step(); err != nil {
t.Fatal(err)
}
}

0 comments on commit ca6dc89

Please sign in to comment.