Skip to content

Commit 92f9ce6

Browse files
yahondaclaude
andcommitted
Add failing test for multiline constant declaration (rsim#207)
Reproduces the issue where accessing a package constant fails when the assignment is wrapped to the next line, as Oracle 19c does in sys.dbms_db_version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 412d59e commit 92f9ce6

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

spec/plsql/variable_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,32 @@
340340

341341
end
342342

343+
describe "constants with multiline declaration" do
344+
before(:all) do
345+
plsql.connect! CONNECTION_PARAMS
346+
plsql.execute "DROP PACKAGE test_multiline_pkg" rescue nil
347+
plsql.execute <<-SQL
348+
CREATE OR REPLACE PACKAGE test_multiline_pkg IS
349+
multiline_constant CONSTANT PLS_INTEGER :=
350+
42;
351+
END;
352+
SQL
353+
plsql.execute <<-SQL
354+
CREATE OR REPLACE PACKAGE BODY test_multiline_pkg IS
355+
END;
356+
SQL
357+
end
358+
359+
after(:all) do
360+
plsql.execute "DROP PACKAGE test_multiline_pkg" rescue nil
361+
plsql.logoff
362+
end
363+
364+
it "should get constant with multiline assignment" do
365+
expect(plsql.test_multiline_pkg.multiline_constant).to eq(42)
366+
end
367+
end
368+
343369
describe "object type" do
344370
before(:all) do
345371
plsql.connect! CONNECTION_PARAMS

0 commit comments

Comments
 (0)