From 8b730076987131949214d51ba4439aa14fdbfde5 Mon Sep 17 00:00:00 2001 From: Sydney W Badescu Date: Tue, 21 Nov 2023 09:17:44 -0800 Subject: [PATCH] Fixed the infinite loop in ChatServer.java and updated test.sh to run tests. --- ChatServer.java | 5 ++--- test.sh | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ChatServer.java b/ChatServer.java index d000eb6..31683f4 100644 --- a/ChatServer.java +++ b/ChatServer.java @@ -88,9 +88,8 @@ else if (url.getPath().equals("/semantic-analysis")) { } if (new String(Character.toChars(character)).equals("🥹")) { analysis = " This message has a awwww vibe."; - } else { - characterIndex += 1; - } + } + characterIndex += 1; } if (numberOfExclamationMarks > 2) { analysis += " This message ends forcefully."; diff --git a/test.sh b/test.sh index dd3fad0..96307a0 100644 --- a/test.sh +++ b/test.sh @@ -2,4 +2,4 @@ set -e javac -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar *.java -# java -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar org.junit.runner.JUnitCore +java -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar org.junit.runner.JUnitCore SemanticAnalysisHandlerTests