Repository navigation
Description
Describe the bug
When reading, scanning and referencing lines of code from (all|dba|user)_source there is a corner case that is not handled correctly right now in utPLSQL.
When a line of source is more than 4000 bytes long, then the source line will actually be stored in two lines of the source view.
The problem was noticed and reported as a fix for ut_metadata.get_source_definition_line function.
But the fix proposed in #1394 only addresses one aspect of the issue.
The aspect that is visible in the expectation result.
To Reproduce
Create the test package with a long line before the expectation result
create or replace package test_package1 is
--%suite
--%test
procedure sp_test;
end;
create or replace package body test_package1 is
procedure sp_test is
begin
/* [comment way over 4000 limit]*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
ut.expect(1).to_equal(2);
end;
end;Run the tests
begin
ut.run('test_package1');
end;The result shows:
Failures:
1) sp_test
Actual: 1 (number) was expected to equal: 2 (number)
at "PMUSER.TEST_PACKAGE1.SP_TEST", line 5 *****************************************************************************************************************************************************************************************************************************************/
Finished in ,008209 seconds
1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)
The problem is in the at "PMUSER.TEST_PACKAGE1.SP_TEST", line 5*****...
Expected behavior
The text should be at "PMUSER.TEST_PACKAGE1.SP_TEST", line 5 ut.expect(1).to_equal(2);
Activity
mathewbutler commentedon Nov 19, 2026
I've watched the background to this.
A really minor comment/suggestion - it's not obvious that the long line has the required length. One way to achieve the same is something like the below. I've not used labels on an anon block before, but doco appears to suggest this works. Unable to test this currently.