public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nagesh Dhope <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: patch for RE-SQL test cases for FTS Dictionaries.
Date: Thu, 11 Jul 2019 16:18:11 +0530
Message-ID: <CAA3zdZq7Dn9o=pUUZ-Te1PC-sS82-muR97CrpP-qe6y_2e0Emw@mail.gmail.com> (raw)

Hi Hackers,

PFA, patch for RE-SQL test cases for FTS Dictionaries.

-- 
Thanks,
Nagesh


Attachments:

  [application/octet-stream] fts_dictionaries_resql_v1.patch (4.3K, 3-fts_dictionaries_resql_v1.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/alter_fts_dictionary_delete_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/alter_fts_dictionary_delete_options.sql
new file mode 100644
index 0000000..1ab7cce
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/alter_fts_dictionary_delete_options.sql
@@ -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';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/alter_fts_dictionary_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/alter_fts_dictionary_options.sql
new file mode 100644
index 0000000..7a50ee8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/alter_fts_dictionary_options.sql
@@ -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';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/create_fts_dictionary.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/create_fts_dictionary.sql
new file mode 100644
index 0000000..38aadc5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/create_fts_dictionary.sql
@@ -0,0 +1,7 @@
+-- Text Search Dictionary: public."Dictionary1_$%{}[]()&*^!@""'`\/#"
+
+-- DROP TEXT SEARCH DICTIONARY public."Dictionary1_$%{}[]()&*^!@""'`\/#";
+
+CREATE TEXT SEARCH DICTIONARY public."Dictionary1_$%{}[]()&*^!@""'`\/#" (
+    TEMPLATE = simple
+);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json
new file mode 100644
index 0000000..5487b78
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json
@@ -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": {}
+    }
+  ]
+}


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: patch for RE-SQL test cases for FTS Dictionaries.
  In-Reply-To: <CAA3zdZq7Dn9o=pUUZ-Te1PC-sS82-muR97CrpP-qe6y_2e0Emw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox