Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant tests #70

Open
wants to merge 6 commits into
base: client_tests
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ set ::all_tests {
unit/client-eviction
unit/violations
unit/replybufsize
unit/client
}
# Index to the next test to run in the ::all_tests list.
set ::next_test 0
Expand Down
59 changes: 59 additions & 0 deletions tests/unit/client.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
start_server {} {
test {CLIENT Caching wrong number of arguments} {
catch {r client caching} err
set _ $err
} {ERR*wrong number of arguments*}

test {CLIENT Caching test tracking} {
# Checks if the CLIENT_TRACKING flag is working as intended
r CLIENT TRACKING off optout
catch {r client caching on} err
set _ $err
} {ERR*when the client is in tracking mode*}

test {CLIENT Caching ON with optout} {
r CLIENT TRACKING ON optout
catch {r client caching on} err
set _ $err
} {ERR*syntax*}

test {CLIENT kill wrong address or no port} {
catch {r client kill 999.999.999.000:} err
set _ $err
} {ERR*No such*}

test {CLIENT no-evict wrong argument} {
catch {r client no-evict wrongInput} err
set _ $err
} {ERR*syntax*}

test {CLIENT pause wrong timeout type} {
catch {r client pause abc} err
set _ $err
} {ERR*timeout is not an integer*}

test {CLIENT pause negative timeout} {
catch {r client pause -1} err
set _ $err
} {ERR timeout is negative}

test {CLIENT reply wrong argument} {
catch {r client reply wrongInput} err
set _ $err
} {ERR*syntax*}

test {CLIENT tracking wrong argument} {
catch {r client tracking wrongInput} err
set _ $err
} {ERR*syntax*}

test {CLIENT tracking wrong option} {
catch {r client tracking on wrongInput} err
set _ $err
} {ERR*syntax*}

test {CLIENT getname check if name set correctly} {
r client setname testName
r client getName
} {testName}
}