This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
standalone/src/test/java/com/trivadis/plsql/formatter/settings/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1851,7 +1851,7 @@ a8_one_space_after:
18511851 | a8_update
18521852-> {
18531853 var node = tuple.get("node");
1854- if (!hasCommentsBetweenPos(node.from, node.to)) {
1854+ if (overrideIndents(node.from) && !hasCommentsBetweenPos(node.from, node.to)) {
18551855 struct.putNewline(node.to, " ");
18561856 var content = target.src.get(node.from).content;
18571857 logger.fine(struct.getClass(), "a8_one_space_after: <" + content + "> at " + node.to + ".");
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ public void alter_function() throws IOException {
2727 var actual = getFormatter ().format (input );
2828 var expected = """
2929 alter
30- function f
30+ function
31+ f
3132 compile
3233 reuse
3334 settings;
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 org .junit .jupiter .api .Test ;
5+ import org .junit .jupiter .api .TestInstance ;
6+
7+ @ TestInstance (TestInstance .Lifecycle .PER_CLASS )
8+ public class Issue_267_spaces_in_grant extends ConfiguredTestFormatter {
9+ @ Test
10+ public void keep_spaces_in_grant_statements () {
11+ var input = """
12+ grant debug connect session to scott;
13+ grant debug any procedure to scott;
14+ grant execute on dbms_debug_jdwp to scott;
15+ """ ;
16+ formatAndAssert (input );
17+ }
18+
19+ @ Test
20+ public void keep_spaces_in_grant_statements_one_token_per_line () {
21+ var input = """
22+ grant
23+ debug
24+ connect
25+ session
26+ to
27+ scott;
28+
29+ grant
30+ debug
31+ any
32+ procedure
33+ to
34+ scott;
35+
36+ grant
37+ execute
38+ on
39+ dbms_debug_jdwp
40+ to
41+ scott;
42+ """ ;
43+ formatAndAssert (input );
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments