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/rules Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .trivadis .plsql .formatter .settings .tests .rules ;
2+
3+ import com .trivadis .plsql .formatter .settings .ConfiguredTestFormatter ;
4+ import org .junit .jupiter .api .Nested ;
5+ import org .junit .jupiter .api .Test ;
6+
7+ public class A23_enforce_line_break_after_single_line_comment extends ConfiguredTestFormatter {
8+
9+ @ Nested
10+ class case_expression {
11+
12+ @ Test
13+ public void comment_before_then () {
14+ var sql = """
15+ select empno,
16+ ename,
17+ case
18+ when 'JOB' = 'SALESMAN' -- make gender-neutral
19+ then
20+ 'SALESPERSON'
21+ else
22+ job
23+ end as job,
24+ sal
25+ from emp;
26+ """ ;
27+ formatAndAssert (sql );
28+ }
29+
30+ @ Test
31+ public void comment_after_every_token () {
32+ var sql = """
33+ select empno,
34+ ename,
35+ case
36+ when -- comment 1
37+ 'JOB' -- comment 2
38+ = -- comment 3
39+ 'SALESMAN' -- comment 4
40+ then -- comment 5
41+ 'SALESPERSON' -- comment 6
42+ else -- comment 7
43+ job -- comment 8
44+ end -- comment 9
45+ as -- comment 10
46+ job,
47+ sal
48+ from emp;
49+ """ ;
50+ formatAndAssert (sql );
51+ }
52+ }
53+ }
You can’t perform that action at this time.
0 commit comments