Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
32 lines
818 B
Nix
32 lines
818 B
Nix
import ./make-test-python.nix ({ pkgs, lib, ...} : {
|
|
name = "tsja";
|
|
meta = {
|
|
maintainers = with lib.maintainers; [ chayleaf ];
|
|
};
|
|
|
|
nodes = {
|
|
master =
|
|
{ config, ... }:
|
|
|
|
{
|
|
services.postgresql = {
|
|
enable = true;
|
|
extraPlugins = ps: with ps; [
|
|
tsja
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
master.wait_for_unit("postgresql")
|
|
master.succeed("sudo -u postgres psql -f /run/current-system/sw/share/postgresql/extension/libtsja_dbinit.sql")
|
|
# make sure "日本語" is parsed as a separate lexeme
|
|
master.succeed("""
|
|
sudo -u postgres \\
|
|
psql -c "SELECT * FROM ts_debug('japanese', 'PostgreSQLで日本語のテキスト検索ができます。')" \\
|
|
| grep "{日本語}"
|
|
""")
|
|
'';
|
|
})
|