03-try.sql (1398B)
1 BEGIN; 2 -- Disable printing warning messages 3 SET client_min_messages = ERROR; 4 5 -- load pgtap - change next line to point to correct path for your system! 6 \i t/00-load.sql.inc 7 8 9 SELECT plan(7); 10 11 SELECT is( ( SELECT count(*) FROM _v.patches ), 0::bigint, 'When running tests _v.patches table should be empty to prevent bad interactions between patches and tests.' ); 12 13 SELECT is( 14 _v.try_register_patch( 'first_patch' ), 15 true, 16 'Installation of patch without dependencies and conflicts.' 17 ); 18 19 SELECT is( 20 _v.try_register_patch( 'first_patch' ), 21 false, 22 'Reinstallation of patch without dependencies and conflicts.' 23 ); 24 25 SELECT is( 26 _v.try_register_patch( 'second_patch', ARRAY['first_patch'] ), 27 true, 28 'Installation of patch with correct dependency.' 29 ); 30 31 SELECT is( 32 _v.try_register_patch( 'third_patch', ARRAY['bad_patch'] ), 33 false, 34 'Installation of patch with bad dependency.' 35 ); 36 37 SELECT is( 38 _v.try_register_patch( 'fourth_patch', NULL, ARRAY['bad_patch'] ), 39 true, 40 'Installation of patch with and correct conflict.' 41 ); 42 43 SELECT is( 44 _v.try_register_patch( 'fifth_patch', NULL, ARRAY['first_patch'] ), 45 false, 46 'Installation of patch with bad conflict.' 47 ); 48 49 SELECT * FROM finish(); 50 51 ROLLBACK; 52