File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 11BEGIN ;
22-- Plan the tests.
3- SELECT plan(2 );
3+ SELECT plan(3 );
44
55INSERT INTO rate_limit .sessions (id, name_, type_)
66SELECT
77 ' 00000000-0000-0000-0000-000000000000' ::uuid AS id,
88 ' dedicated-test' ::text AS name_,
9- ' aggregated' ::text AS type_;
9+ ' aggregated' ::text AS type_
10+ UNION
11+ SELECT
12+ ' 00000000-1111-1111-1111-000000000000' ::uuid AS id,
13+ ' dedicated-test-2' ::text AS name_,
14+ ' aggregated' ::text AS type_;;
1015
1116INSERT INTO rate_limit .records_aggregated (key, session_id)
1217SELECT
@@ -23,6 +28,16 @@ SELECT results_eq(
2328 ' rate_limit.agg_increment returns correct count for new key'
2429);
2530
31+ SELECT results_eq(
32+ $have$
33+ SELECT agg_increment AS count FROM rate_limit .agg_increment (' new-key' , ' 00000000-1111-1111-1111-000000000000' )
34+ $have$,
35+ $want$
36+ SELECT 1 ::int AS count;
37+ $want$,
38+ ' rate_limit.agg_increment returns correct count for new key on different session'
39+ );
40+
2641SELECT results_eq(
2742 $have$
2843 SELECT agg_increment AS count FROM rate_limit .agg_increment (' existing-key' , ' 00000000-0000-0000-0000-000000000000' )
Original file line number Diff line number Diff line change 11BEGIN ;
22-- Plan the tests.
3- SELECT plan(3 );
3+ SELECT plan(4 );
44
55INSERT INTO rate_limit .sessions (id, name_, type_)
66SELECT
77 ' 00000000-0000-0000-0000-000000000000' ::uuid AS id,
88 ' dedicated-test' ::text AS name_,
9+ ' individual' ::text AS type_
10+ UNION
11+ SELECT
12+ ' 00000000-1111-1111-1111-000000000000' ::uuid AS id,
13+ ' dedicated-test-2' ::text AS name_,
914 ' individual' ::text AS type_;
1015
1116INSERT INTO rate_limit .individual_records (key, session_id)
@@ -23,6 +28,16 @@ SELECT results_eq(
2328 ' rate_limit.ind_increment returns correct count for new key'
2429);
2530
31+ SELECT results_eq(
32+ $have$
33+ SELECT ind_increment AS count FROM rate_limit .ind_increment (' new-key' , ' 00000000-1111-1111-1111-000000000000' )
34+ $have$,
35+ $want$
36+ SELECT 1 ::int AS count;
37+ $want$,
38+ ' rate_limit.ind_increment returns correct count for new key on another session'
39+ );
40+
2641SELECT results_eq(
2742 $have$
2843 SELECT ind_increment AS count FROM rate_limit .ind_increment (' existing-key' , ' 00000000-0000-0000-0000-000000000000' )
You can’t perform that action at this time.
0 commit comments