Skip to content

Commit

Permalink
Add ui-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
francislow committed Aug 26, 2019
1 parent ac0510a commit dbc503a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions text-ui-test/ACTUAL.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Hello! I'm Duke
What can I do for you?
Got it. I've added this task:
[T][?] check hotels for shengyi
Now you have 1 tasks in the list.
Bye. Hope to see you again soon!
6 changes: 6 additions & 0 deletions text-ui-test/EXPECTED.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Hello! I'm Duke
What can I do for you?
Got it. I've added this task:
[T][?] check hotels for shengyi
Now you have 1 tasks in the list.
Bye. Hope to see you again soon!
2 changes: 2 additions & 0 deletions text-ui-test/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
todo check hotels for shengyi
bye
21 changes: 21 additions & 0 deletions text-ui-test/runtest.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@ECHO OFF

REM create bin directory if it doesn't exist
if not exist ..\bin mkdir ..\bin

REM delete output from previous run
del ACTUAL.TXT

REM compile the code into the bin folder
javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java
IF ERRORLEVEL 1 (
echo ********** BUILD FAILURE **********
exit /b 1
)
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 compare the output to the expected output
FC ACTUAL.TXT EXPECTED.TXT

0 comments on commit dbc503a

Please sign in to comment.