Automated testing script for Sprint 4. If you want to contribute, upload an .html file with the input and an associated .txt file for the expected output (just make it empty if it's supposed to be wrong). If there is a single file that is not .html or .txt committed, mods will ban the person responsible for committing those files from the Discord server and remove them from the organization.
Use python3 test.py
for regular testing (requires parse
from pip3
to be installed)
To test with valgrind, run python3 test.py -m
or python3 test.py --memory
(only works on Linux)
Note that you need to manually review valgrind output for memory testing. The script will not automatically check if the program does not leak memory.
The automated script ignores all whitespaces when comparing output. This means that the script may make a mistake during grading and declare your program correct when it may not be. Always make sure to manually feed your program a couple of invalid examples and see if it behaves correctly.
Tests to make sure only one pair of <html></html>
and <body></body>
exist in your file, and that no tags exist
outside of the scope of html.
Various tests collected from Campuswire posts.
cw_test_1
: tests missing recognized tagcw_test_2
: tests unrecognized entity replacement
Tests from this Campuswire post by Min Lu (thanks!)
See the linked post for details. Files 1-9 should be valid examples, while files 10-17 are invalid examples.
Various tests collected from Discord.
discord_test_1
: test case from Sprint 3 (should be blank under Sprint 4 requirements since it is invalid)discord_test_2
: test case from Sprint 3 (also should be blank as it has an invalid tag level)discord_test_3
: tests missing closing recognized tag
Test cases from the handout.
handout_test_1
: test case from Sprint 3handout_test_2
: test case from Sprint 3handout_test_3
: test case from Sprint 4handout_test_4
: tests missing closing recognized taghandout_test_5
: tests file with invalid level nesting
Miscellaneous test cases
self_test_1
: tests all entity replacementsself_test_2
: tests invalid file with multiple <html> tagsself_test_3
: tests entity replacements in title attributesself_test_4
: tests invalid file with an unrecognized, mismatched closing tagself_test_5
: tests invalid file with missing <html> tagself_test_6
: tests invalid file with missing <body> tag