From fd3c7a60a806a901a51261665be924e538c2c974 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 11 Nov 2021 15:53:51 +0100 Subject: [PATCH] fixed bug in TextOutput.java --- src/TextOutput.java | 2 +- test/TextOutputTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TextOutput.java b/src/TextOutput.java index 6a94a63..30f9337 100644 --- a/src/TextOutput.java +++ b/src/TextOutput.java @@ -99,7 +99,7 @@ public class TextOutput { System.out.print(word); if(!(currentWordNumber == lastWordNumber)) { System.out.print(" "); - currentLength = word.length(); + currentLength = word.length() + 1; } } } diff --git a/test/TextOutputTest.java b/test/TextOutputTest.java index 7aa6658..57bb624 100644 --- a/test/TextOutputTest.java +++ b/test/TextOutputTest.java @@ -27,5 +27,9 @@ class TextOutputTest { @Test public void print() { textOutput.print(text); + System.out.println("fertig"); + textOutput.formatRaw(); + textOutput.print(text); + System.out.println("fertig"); } } \ No newline at end of file