Skip to content

Commit d7ac13d

Browse files
committed
Fixing the test
1 parent bb2f17d commit d7ac13d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/java/org/fxapps/llmfx/tools/graphics/JFXDrawerTool.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ You can draw using the following commands separated by line break (\n):
6464
text x y "string"
6565
""")
6666
public void draw(String dsl) {
67-
clearRenderNode();
67+
applyDSL(dsl);
68+
setEditorContent(dsl);
69+
}
70+
71+
void applyDSL(String dsl) {
72+
clearRenderNode();
6873
String[] lines = dsl.split("\\R");
6974
for (String line : lines) {
7075
var tokens = line.trim().split("\\s+");
@@ -117,7 +122,6 @@ public void draw(String dsl) {
117122

118123
}
119124
}
120-
setEditorContent(dsl);
121125
}
122126

123127
private double[][] extractPoints(double[] params) {

src/test/java/org/fxapps/llmfx/tools/graphics/JFXDrawerToolTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ class JFXDrawerToolTest {
1717
@BeforeEach
1818
public void setup() {
1919
tool = new JFXDrawerTool();
20-
tool.gc = mock();
20+
tool.gc = mock();
21+
2122
}
2223

2324
@Test
2425
public void testDSL() {
25-
tool.draw("""
26+
tool.applyDSL("""
2627
background 0 10 20
2728
color 255 200 10
2829
rect 1 2 3 4

0 commit comments

Comments
 (0)