check50

cs50/problems/2022/x/caesar


:) caesar.c exists.

Log
checking that caesar.c exists...

:) caesar.c compiles.

Log
running clang caesar.c -o caesar -std=c11 -ggdb -lm -lcs50...

:( encrypts "a" as "b" using 1 as key

Cause
expected "ciphertext: b\...", not "ciphertext: \n..."

Log
running ./caesar 1...
sending input a...
checking for output "ciphertext: b\n"...

Expected Output:
ciphertext: b\n
Actual Output:
ciphertext: 
b\x01

:( encrypts "barfoo" as "yxocll" using 23 as key

Cause
expected "ciphertext: yx...", not "ciphertext: \n..."

Log
running ./caesar 23...
sending input barfoo...
checking for output "ciphertext: yxocll\n"...

Expected Output:
ciphertext: yxocll\n
Actual Output:
ciphertext: 
y\x01x\x01o\x01c\x01l\x01l\x01

:( encrypts "BARFOO" as "EDUIRR" using 3 as key

Cause
expected "ciphertext: ED...", not "ciphertext: \n..."

Log
running ./caesar 3...
sending input BARFOO...
checking for output "ciphertext: EDUIRR\n"...

Expected Output:
ciphertext: EDUIRR\n
Actual Output:
ciphertext: 
E\x01D\x01U\x01I\x01R\x01R\x01

:( encrypts "BaRFoo" as "FeVJss" using 4 as key

Cause
expected "ciphertext: Fe...", not "ciphertext: \n..."

Log
running ./caesar 4...
sending input BaRFoo...
checking for output "ciphertext: FeVJss\n"...

Expected Output:
ciphertext: FeVJss\n
Actual Output:
ciphertext: 
F\x01e\x01V\x01J\x01s\x01s\x01

:( encrypts "barfoo" as "onesbb" using 65 as key

Cause
expected "ciphertext: on...", not "ciphertext: \n..."

Log
running ./caesar 65...
sending input barfoo...
checking for output "ciphertext: onesbb\n"...

Expected Output:
ciphertext: onesbb\n
Actual Output:
ciphertext: 
o\x01n\x01e\x01s\x01b\x01b\x01

:( encrypts "world, say hello!" as "iadxp, emk tqxxa!" using 12 as key

Cause
expected "ciphertext: ia...", not "ciphertext: \n..."

Log
running ./caesar 12...
sending input world, say hello!...
checking for output "ciphertext: iadxp, emk tqxxa!\n"...

Expected Output:
ciphertext: iadxp, emk tqxxa!\n
Actual Output:
ciphertext: 
i\x01a\x01d\x01x\x01p\x01\x01\x01e\x01m\x01k\x01\x01t\x01q\x01x\x01x\x01a\x01\x01

:( handles lack of argv[1]

Cause
expected exit code 1, not 0

Log
running ./caesar...
checking that program exited with status 1...

:( handles non-numeric key

Cause
expected exit code 1, not 0

Log
running ./caesar 2x...
checking that program exited with status 1...

:( handles too many arguments

Cause
expected exit code 1, not 0

Log
running ./caesar 1 2...
checking that program exited with status 1...