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

Commit 521a068

Browse files
Merge pull request #259 from Trivadis/bugfix/issue-256-linebreak-in-string
add test case to reproduce issue #256
2 parents e077947 + 419993e commit 521a068

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.trivadis.plsql.formatter.settings.tests.issues;
2+
3+
import com.trivadis.plsql.formatter.settings.ConfiguredTestFormatter;
4+
import org.junit.jupiter.api.Disabled;
5+
import org.junit.jupiter.api.Test;
6+
import org.junit.jupiter.api.TestInstance;
7+
8+
import java.io.IOException;
9+
10+
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
11+
@Disabled("Bug in SQLDev 23.1, SQLcl 23.3")
12+
public class Issue_256_linebreak_in_string extends ConfiguredTestFormatter {
13+
@Test
14+
public void escaped_entity_in_string() throws IOException {
15+
var input = """
16+
begin
17+
dbms_output.put_line('</');
18+
end;
19+
/
20+
""";
21+
var expected = """
22+
begin
23+
dbms_output.put_line('</');
24+
end;
25+
/
26+
""";
27+
var actual = getFormatter().format(input);
28+
assertEquals(expected, actual);
29+
}
30+
31+
@Test
32+
public void semi_slash_in_string() throws IOException {
33+
var input = """
34+
begin
35+
dbms_output.put_line(';/');
36+
end;
37+
/
38+
""";
39+
var expected = """
40+
begin
41+
dbms_output.put_line(';/');
42+
end;
43+
/
44+
""";
45+
var actual = getFormatter().format(input);
46+
assertEquals(expected, actual);
47+
}
48+
49+
}

0 commit comments

Comments
 (0)