Add Reverse Engineered SQL tests for FTS Dictionaries. Fixes #4460

This commit is contained in:
Nagesh Dhope
2019-07-11 14:00:11 +01:00
committed by Dave Page
parent 4cbc1f2f59
commit 379b92729a
5 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
-- Text Search Dictionary: public."Test Dictionary Edit#1"
-- DROP TEXT SEARCH DICTIONARY public."Test Dictionary Edit#1";
CREATE TEXT SEARCH DICTIONARY public."Test Dictionary Edit#1" (
TEMPLATE = simple
);
COMMENT ON TEXT SEARCH DICTIONARY public."Test Dictionary Edit#1"
IS 'Test Description';

View File

@@ -0,0 +1,11 @@
-- Text Search Dictionary: public."Test Dictionary Edit#1"
-- DROP TEXT SEARCH DICTIONARY public."Test Dictionary Edit#1";
CREATE TEXT SEARCH DICTIONARY public."Test Dictionary Edit#1" (
TEMPLATE = simple,
stopwords = english
);
COMMENT ON TEXT SEARCH DICTIONARY public."Test Dictionary Edit#1"
IS 'Test Description';

View File

@@ -0,0 +1,7 @@
-- Text Search Dictionary: public."Dictionary1_$%{}[]()&*^!@""'`\/#"
-- DROP TEXT SEARCH DICTIONARY public."Dictionary1_$%{}[]()&*^!@""'`\/#";
CREATE TEXT SEARCH DICTIONARY public."Dictionary1_$%{}[]()&*^!@""'`\/#" (
TEMPLATE = simple
);

View File

@@ -0,0 +1,62 @@
{
"scenarios": [
{
"type": "create",
"name": "Create FTS Dictionary",
"endpoint": "NODE-fts_dictionary.obj",
"sql_endpoint": "NODE-fts_dictionary.sql_id",
"data": {
"name": "Dictionary1_$%{}[]()&*^!@\"'`\\/#",
"template": "simple",
"options": [],
"schema": "public",
"schema_id": "<SCHEMA_ID>",
"owner": "postgres"
},
"expected_sql_file": "create_fts_dictionary.sql"
},
{
"type": "alter",
"name": "Alter FTS Dictionary",
"endpoint": "NODE-fts_dictionary.obj_id",
"sql_endpoint": "NODE-fts_dictionary.sql_id",
"data": {
"name": "Test Dictionary Edit#1",
"description": "Test Description",
"options": {
"added": [
{
"value": "english",
"option": "stopwords"
}
]
}
},
"expected_sql_file": "alter_fts_dictionary_options.sql"
},
{
"type": "alter",
"name": "Alter FTS Dictionary | Delete Options",
"endpoint": "NODE-fts_dictionary.obj_id",
"sql_endpoint": "NODE-fts_dictionary.sql_id",
"data": {
"options": {
"deleted": [
{
"value": "english",
"option": "stopwords"
}
]
}
},
"expected_sql_file": "alter_fts_dictionary_delete_options.sql"
},
{
"type": "delete",
"name": "Drop FTS Dictionary",
"endpoint": "NODE-fts_dictionary.obj_id",
"sql_endpoint": "NODE-fts_dictionary.sql_id",
"data": {}
}
]
}