]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/t/public.first.pg
LP1773452: Repeating copy alerts
[working/Evergreen.git] / Open-ILS / src / sql / Pg / t / public.first.pg
1 -- Load the TAP functions.
2 BEGIN;
3
4 -- Plan the tests.
5 SELECT plan(2);
6
7 -- Run the tests. 
8 SELECT is(
9     (SELECT public.first(name) FROM config.copy_status WHERE id in (1,2,3)) ,
10     (SELECT name FROM config.copy_status WHERE id = 1),
11     'testing having three rows; picking first row'
12 );
13
14 SELECT is(
15     (SELECT public.first(name) FROM config.copy_status WHERE id = 1) ,
16     (SELECT name FROM config.copy_status WHERE id = 1),
17     'testing having one row; picking first row'
18 );
19
20 -- Finish the tests and clean up.
21 SELECT * FROM finish();
22 ROLLBACK;