forked from nus-cs2103-AY2324S1/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A-TextUiTesting added ability to test using I/O redirection technique
- Loading branch information
1 parent
109de24
commit 55e3862
Showing
4 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,6 @@ public static void main(String[] args) { | |
} | ||
|
||
|
||
|
||
} else { | ||
try { | ||
throw new UnknownInputException(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
Hello from | ||
____ _ | ||
| _ \ _ _| | _____ | ||
| | | | | | | |/ / _ \ | ||
| |_| | |_| | < __/ | ||
|____/ \__,_|_|\_\___| | ||
Hello I'm Johnnythesnake | ||
What can I do for you? | ||
Enter a command: Got it. I've added this task: | ||
[T][ ] borrow book | ||
Now you have 1 tasks in the list. | ||
Enter a command: Here are the tasks in your list: | ||
1.[T][ ] borrow book | ||
Enter a command: Got it. I've added this deadline: | ||
[D][ ] project (by: 2023-08-31) | ||
Now you have 2 tasks in the list. | ||
Enter a command: Here are the tasks in your list: | ||
1.[T][ ] borrow book | ||
2.[D][ ] project (by: 2023-08-31) | ||
Enter a command: Got it. I've added this task: | ||
[E][ ] meeting (from: 2023-08-27 3pm to: 5pm) | ||
Now you have 3 tasks in the list. | ||
Enter a command: Here are the tasks in your list: | ||
1.[T][ ] borrow book | ||
2.[D][ ] project (by: 2023-08-31) | ||
3.[E][ ] meeting (from: 2023-08-27 3pm to: 5pm) | ||
Enter a command: OOPS!!! I'm sorry, but I don't know what that means :-( | ||
Enter a command: Bye. Hope to see you again soon! | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
todo borrow book | ||
list | ||
deadline project /by 2023-08-31 | ||
list | ||
event meeting /from 2023-08-27 3pm /to 5pm | ||
list | ||
unknown | ||
bye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
@ECHO OFF | ||
|
||
REM create bin directory if it doesn't exist | ||
if not exist ..\bin mkdir ..\bin | ||
|
||
REM delete output from previous run | ||
if exist ACTUAL.TXT del ACTUAL.TXT | ||
REM Set the path to the source code directory | ||
SET SRC_PATH=C:\Users\chang\Downloads\CS2103\ip\src\main\java | ||
|
||
REM Set the path to the bin directory | ||
SET BIN_PATH=C:\Users\chang\Downloads\CS2103\ip\bin | ||
|
||
REM compile the code into the bin folder | ||
javac -cp ..\src\main\java -Xlint:none -d ..\bin ..\src\main\java\*.java | ||
REM Delete output from previous run | ||
DEL ACTUAL.TXT | ||
|
||
REM Compile the code into the bin folder | ||
javac -cp %SRC_PATH% -Xlint:none -d %BIN_PATH% %SRC_PATH%\*.java | ||
IF ERRORLEVEL 1 ( | ||
echo ********** BUILD FAILURE ********** | ||
exit /b 1 | ||
ECHO ********** BUILD FAILURE ********** | ||
EXIT /B 1 | ||
) | ||
REM no error here, errorlevel == 0 | ||
REM No error here, errorlevel == 0 | ||
|
||
REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT | ||
java -classpath ..\bin Duke < input.txt > ACTUAL.TXT | ||
REM Run the program, feed commands from input.txt file and redirect the output to ACTUAL.TXT | ||
java -classpath %BIN_PATH% Duke < input.txt > ACTUAL.TXT | ||
|
||
REM compare the output to the expected output | ||
REM Compare the output to the expected output | ||
FC ACTUAL.TXT EXPECTED.TXT | ||
|