Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 9cbe54e

Browse files
Merge pull request #271 from Trivadis/bugfix/issue-264-whenever-oserror
Bugfix/issue 264 whenever oserror
2 parents d46ff7d + b68cb5d commit 9cbe54e

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

settings/sql_developer/trivadis_custom_format.arbori

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,12 +2075,18 @@ r3_case_expressions:
20752075
& parent < node
20762076
;
20772077

2078+
r3_no_commands:
2079+
[node) sqlplus_command & [oserror) 'OSERROR' & [oserror+1 = [node
2080+
;
2081+
20782082
r3_commands:
2079-
r3_sqlplus_commands
2080-
| r3_sql_commands
2081-
| r3_plsql_commands
2082-
| r3_plsql_keywords
2083-
| r3_case_expressions
2083+
(
2084+
r3_sqlplus_commands
2085+
| r3_sql_commands
2086+
| r3_plsql_commands
2087+
| r3_plsql_keywords
2088+
| r3_case_expressions
2089+
) - r3_no_commands
20842090
-> {
20852091
var node = tuple.get("node");
20862092
// do not add a line break on the first line.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
import java.io.IOException;
8+
9+
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
10+
public class Issue_264_exit_in_whenever_oserror extends ConfiguredTestFormatter {
11+
@Test
12+
public void exit_in_whenever_os_error() throws IOException {
13+
var input = """
14+
whenever sqlerror exit failure
15+
whenever oserror exit failure
16+
select * from dual;
17+
""";
18+
formatAndAssert(input);
19+
}
20+
}

0 commit comments

Comments
 (0)