Skip to content

Commit

Permalink
add basic testing
Browse files Browse the repository at this point in the history
  • Loading branch information
abnermtj committed Sep 1, 2020
1 parent 1d08529 commit 7d5a549
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ bin/

/text-ui-test/ACTUAL.txt
text-ui-test/EXPECTED-UNIX.TXT

# Vim files
/*.swp
/*.un~

57 changes: 50 additions & 7 deletions text-ui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
@@ -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!
---------------------------------------
13 changes: 13 additions & 0 deletions text-ui-test/input.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions text-ui-test/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,4 +35,4 @@ then
else
echo "Test result: FAILED"
exit 1
fi
fi

0 comments on commit 7d5a549

Please sign in to comment.