Permalink
Browse files

Add some basic regression test.

  • Loading branch information...
rjuju committed Jul 11, 2015
1 parent c55c9df commit 3bf0e6d118bd0d0c863513f2d3636b485763d873
Showing with 38 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +22 −0 expected/hypopg.out
  3. +15 −0 test/sql/hypopg.sql
@@ -5,3 +5,4 @@
*~
.*.sw?
hypopg-*.zip
results/
@@ -0,0 +1,22 @@
-- SETUP
CREATE EXTENSION hypopg;
CREATE TABLE hypo (id integer, val text);
INSERT INTO hypo SELECT i, 'line ' || i
FROM generate_series(1,100000) f(i);
ANALYZE hypo;
-- TESTS
SELECT COUNT(*) AS nb
FROM public.hypopg_create_index('SELECT 1;CREATE INDEX ON hypo(id); SELECT 2');
WARNING: hypopg: SQL order #1 is not a CREATE INDEX statement
WARNING: hypopg: SQL order #3 is not a CREATE INDEX statement
nb
----
1
(1 row)

SELECT nspname, relname, amname FROM public.hypopg_list_indexes();
nspname | relname | amname
---------+---------+--------
public | hypo | btree
(1 row)

@@ -0,0 +1,15 @@
-- SETUP
CREATE EXTENSION hypopg;

CREATE TABLE hypo (id integer, val text);

INSERT INTO hypo SELECT i, 'line ' || i
FROM generate_series(1,100000) f(i);

ANALYZE hypo;

-- TESTS
SELECT COUNT(*) AS nb
FROM public.hypopg_create_index('SELECT 1;CREATE INDEX ON hypo(id); SELECT 2');

SELECT nspname, relname, amname FROM public.hypopg_list_indexes();

0 comments on commit 3bf0e6d

Please sign in to comment.