This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
tests/src/test/java/com/trivadis/plsql/formatter/settings/tests/issues Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .trivadis .plsql .formatter .settings .tests .issues ;
2+
3+ import com .trivadis .plsql .formatter .settings .ConfiguredTestFormatter ;
4+ import oracle .dbtools .app .Format ;
5+ import org .junit .jupiter .api .BeforeEach ;
6+ import org .junit .jupiter .api .Disabled ;
7+ import org .junit .jupiter .api .Test ;
8+
9+ import java .io .IOException ;
10+
11+ public class Issue_150_define extends ConfiguredTestFormatter {
12+
13+ @ BeforeEach
14+ public void setup_non_trivadis_default_settings () {
15+ getFormatter ().options .put (getFormatter ().idCase , Format .Case .lower );
16+ }
17+
18+ @ Test
19+ @ Disabled ("SQLDev 21.2.1 bug" )
20+ public void set_define_after_at_command () throws IOException {
21+ // in SQLDev 21.2.1 SET is part of the @ command
22+ // As a result DEFINE becomes a command, and it starts on a new line
23+ // Same behavior with START as with @.
24+ var sql = """
25+ define table_folder = 'table'
26+ set define on
27+ @./demo/&&table_folder/drop_demo_tables.sql
28+ set define off
29+ """ ;
30+ formatAndAssert (sql );
31+ }
32+
33+ @ Test
34+ public void commit_after_at_command () throws IOException {
35+ // workaround
36+ var sql = """
37+ define table_folder = 'table'
38+ set define on
39+ @./demo/&&table_folder/drop_demo_tables.sql
40+ commit; -- workaround
41+ set define off
42+ """ ;
43+ formatAndAssert (sql );
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments