From 7d5a5499a988be26ca72333fe79877bbf4754fa4 Mon Sep 17 00:00:00 2001 From: abnermtj Date: Tue, 1 Sep 2020 12:37:07 +0800 Subject: [PATCH] add basic testing --- .gitignore | 5 ++++ text-ui-test/EXPECTED.TXT | 57 ++++++++++++++++++++++++++++++++++----- text-ui-test/input.txt | 13 +++++++++ text-ui-test/runtest.sh | 4 +-- 4 files changed, 70 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index f69985ef1f..8d77e682ea 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,8 @@ bin/ /text-ui-test/ACTUAL.txt text-ui-test/EXPECTED-UNIX.TXT + +# Vim files +/*.swp +/*.un~ + diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 657e74f6e7..68dc142b34 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -1,7 +1,50 @@ -Hello from - ____ _ -| _ \ _ _| | _____ -| | | | | | | |/ / _ \ -| |_| | |_| | < __/ -|____/ \__,_|_|\_\___| - +--------------------------------------- +Hello! I'm Duke +What can I do for you? +--------------------------------------- +I don't understand that command +Command Failed +--------------------------------------- +--------------------------------------- +--------------------------------------- +Got it. I've added this task: + [T][✘] 123 +Now you have 1 task in the list. +--------------------------------------- +--------------------------------------- +1.[T][✘] 123 +--------------------------------------- +--------------------------------------- +Got it. I've added this task: + [E][✘] 123 (at: 12pm) +Now you have 2 tasks in the list. +--------------------------------------- +--------------------------------------- +Got it. I've added this task: + [D][✘] study (by: Sleeptime) +Now you have 3 tasks in the list. +--------------------------------------- +Nice! I've marked this task as done: + [T][✓] 123 +--------------------------------------- +--------------------------------------- +1.[T][✓] 123 +2.[E][✘] 123 (at: 12pm) +3.[D][✘] study (by: Sleeptime) +--------------------------------------- +Nice! I've marked this task as done: + [D][✓] study (by: Sleeptime) +--------------------------------------- +--------------------------------------- +1.[T][✓] 123 +2.[E][✘] 123 (at: 12pm) +3.[D][✓] study (by: Sleeptime) +--------------------------------------- +Command Failed +--------------------------------------- +1.[T][✓] 123 +2.[E][✘] 123 (at: 12pm) +3.[D][✓] study (by: Sleeptime) +--------------------------------------- +Bye. Hope to see you again soon! +--------------------------------------- diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index e69de29bb2..4f57a12483 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -0,0 +1,13 @@ +badcommand +list +todo 123 +list +event 123 /at 12pm +deadline study /by Sleeptime +done 123 +list +done study +list +done +list +bye diff --git a/text-ui-test/runtest.sh b/text-ui-test/runtest.sh index e169618a34..74ad72b963 100644 --- a/text-ui-test/runtest.sh +++ b/text-ui-test/runtest.sh @@ -13,7 +13,7 @@ then fi # compile the code into the bin folder, terminates if error occurred -if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/Duke.java +if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/*.java then echo "********** BUILD FAILURE **********" exit 1 @@ -35,4 +35,4 @@ then else echo "Test result: FAILED" exit 1 -fi \ No newline at end of file +fi