-
Notifications
You must be signed in to change notification settings - Fork 219
Using Test Cases
Beau Dobbin edited this page May 8, 2017
·
3 revisions
In order to use test cases, you should understand the Test Case Format.
It is important to have the latest version of the test cases on your local machine.
- Clone this repository.
- If this repository has been updated since you cloned, Fetch or Merge this repository.
If you don't want to use an automated tester, or there is no automated tester for your language of choice, you can still use the test cases.
- Navigate to the directory that contains your code. For example:
$ cd /PATH/TO/YOUR/CODE
- Run your code with one of the test cases.
- If you use Python, it may look something like this:
$ python your_script.py /PATH/TO/TEST/CASES/input_whatever_1_1.txt
- If you use Java, it may look something like this:
$ java -cp /PATH/TO/YOUR/CLASSES YourSolution /PATH/TO/TEST/CASES/input_whatever_1_1.txt
- Look at the output of your solution. It may look something like this:
5
- Look at the corresponding expected output for the test case. Like this:
$ cat /PATH/TO/TEST/CASES/output_whatever_1_1.txt
5
- If your output matches the expected output, congratulations. If not, you may need to adjust your code.
If you want to use an automated tester, you can test multiple test cases with a single command.
Since each tester is unique, you will need to follow the instructions on the tester page. Here's a directory of testers.