check50
cs50/problems/2020/x/speller
:) dictionary.c, dictionary.h, and Makefile exist
Log
checking that dictionary.c exists...
checking that dictionary.h exists...
:) speller compiles
Log
running make...
checking that program exited with status 0...
:) handles most basic words properly
Log
running ./speller basic/dict basic/text...
checking for output "MISSPELLED WORDS\n\n\nWORDS MISSPELLED: 0\nWORDS IN DICTIONARY: 8\nWORDS IN TEXT: 9\n"...
checking that program exited with status 0...
:( handles min length (1-char) words
Cause
expected "MISSPELLED WOR...", not "MISSPELLED WOR..."
Log
running ./speller min_length/dict min_length/text...
checking for output "MISSPELLED WORDS\n\n\nWORDS MISSPELLED: 0\nWORDS IN DICTIONARY: 1\nWORDS IN TEXT: 1\n"...
Expected Output:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 1
WORDS IN TEXT: 1
Actual Output:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 0
WORDS IN TEXT: 1
:( handles max length (45-char) words
Cause
expected "MISSPELLED WOR...", not "MISSPELLED WOR..."
Log
running ./speller max_length/dict max_length/text...
checking for output "MISSPELLED WORDS\n\n\nWORDS MISSPELLED: 0\nWORDS IN DICTIONARY: 1\nWORDS IN TEXT: 1\n"...
Expected Output:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 1
WORDS IN TEXT: 1
Actual Output:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 0
WORDS IN TEXT: 1
:( handles words with apostrophes properly
Cause
expected "MISSPELLED WOR...", not "MISSPELLED WOR..."
Log
running ./speller apostrophe/without/dict apostrophe/with/text...
checking for output "MISSPELLED WORDS\n\nfoo's\n\nWORDS MISSPELLED: 1\nWORDS IN DICTIONARY: 1\nWORDS IN TEXT: 1\n"...
Expected Output:
MISSPELLED WORDS
foo's
WORDS MISSPELLED: 1
WORDS IN DICTIONARY: 1
WORDS IN TEXT: 1
Actual Output:
MISSPELLED WORDS
foo's
WORDS MISSPELLED: 1
WORDS IN DICTIONARY: 0
WORDS IN TEXT: 1
:( spell-checking is case-insensitive
Cause
expected "MISSPELLED WOR...", not "MISSPELLED WOR..."
Log
running ./speller case/dict case/text...
checking for output "MISSPELLED WORDS\n\n\nWORDS MISSPELLED: 0\nWORDS IN DICTIONARY: 1\nWORDS IN TEXT: 8\n"...
Expected Output:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 1
WORDS IN TEXT: 8
Actual Output:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 0
WORDS IN TEXT: 8
:) handles substrings properly
Log
running ./speller substring/dict substring/text...
checking for output "MISSPELLED WORDS\n\nca\ncats\ncaterpill\ncaterpillars\n\nWORDS MISSPELLED: 4\nWORDS IN DICTIONARY: 2\nWORDS IN TEXT: 6\n"...
checking that program exited with status 0...
:) program is free of memory errors
Log
running valgrind --show-leak-kinds=all --xml=yes --xml-file=/tmp/tmp39tx2m6r -- ./speller substring/dict substring/text...
checking for output "MISSPELLED WORDS\n\nca\ncats\ncaterpill\ncaterpillars\n\nWORDS MISSPELLED: 4\nWORDS IN DICTIONARY: 2\nWORDS IN TEXT: 6\n"...
checking that program exited with status 0...
checking for valgrind errors...