Skip to content
Snippets Groups Projects
Commit 9b00daf2 authored by jl4589's avatar jl4589
Browse files

going back one

parent cb5b79e7
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -84,6 +84,50 @@ EOF
[ "$status" -ne 0 ]
}
@test "Server handles quotes" {
start_server
run ./dsh -c -i 127.0.0.1 -p 5678 <<EOF
echo "Hello, World!"
exit
EOF
# Assertions
[ "$status" -eq 0 ]
[[ "$output" == *"Hello, World!"* ]]
# Stop the server
stop_server
}
@test "Server handles misspelled commands" {
start_server
run ./dsh -c -i 127.0.0.1 -p 5678 <<EOF
ehco Hello, World!
exit
EOF
[ "$status" -eq 0 ]
[[ "$output" == *"not found"* || "$output" == *"error"* ]]
stop_server
}
@test "Server handles complex commands with pipes and quotes" {
start_server
run ./dsh -c -i 127.0.0.1 -p 5678 <<EOF
echo "Hello, World!" | wc -c
exit
EOF
[ "$status" -eq 0 ]
[[ "$output" == *"14"* ]]
stop_server
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment