- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitdd2243f
committed
Improve regression tests' code coverage for plpgsql control structures.
I noticed that our code coverage report showed considerable deficiencyin test coverage for PL/pgSQL control statements. Notably, bothexec_stmt_block and most of the loop control statements had very poorcoverage of handling of return/exit/continue result codes from theirchild statements; and exec_stmt_fori was seriously lacking in featurecoverage, having no test that exercised its BY or REVERSE features,nor verification that its overflow defenses work.Now that we have some infrastructure for plpgsql-specific test scripts,the natural thing to do is make a new script rather than further extendplpgsql.sql. So I created a new script plpgsql_control.sql with thecharter to test plpgsql control structures, and moved a few existingtests there because they fell entirely under that charter. I thenadded new test cases that exercise the bits of code complained of above.Of the five kinds of loop statements, only exec_stmt_while's result codehandling is fully exercised by these tests. That would be a deficiencyas things stand, but a follow-on commit will merge the loop statements'result code handling into one implementation. So testing each usage ofthat implementation separately seems redundant.In passing, also add a couple test cases to plpgsql.sql to more fullyexercise plpgsql's code related to expanded arrays --- I had thoughtthat area was sufficiently covered already, but the coverage reportshowed a couple of un-executed code paths.Discussion:https://postgr.es/m/26314.1514670401@sss.pgh.pa.us1 parent5303ffe commitdd2243f
File tree
5 files changed
+1171
-765
lines changed- src
- pl/plpgsql/src
- expected
- sql
- test/regress
- expected
- sql
5 files changed
+1171
-765
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
|
0 commit comments
Comments
(0)