Skip to content

Commit

Permalink
Add memory integration tests
Browse files Browse the repository at this point in the history
Will use them to confirm allocation override changes redis memory report
(#2)
  • Loading branch information
aviggiano committed May 20, 2017
1 parent 7f90043 commit c66ec00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ function test_bitpos()
EXPECTED="3"
[ "$FOUND" == "$EXPECTED" ]
}
function test_memory()
{
echo "test_memory"
FOUND=$(echo "FLUSHDB" | redis-cli)
FOUND=$(echo "INFO memory" | redis-cli | grep --color=no "used_memory:" | sed 's/\r//g')
EXPECTED="used_memory:827376"
[ "$FOUND" == "$EXPECTED" ]

FOUND=$(echo "R.SETBIT test_memory 0 1" | redis-cli)
FOUND=$(echo "INFO memory" | redis-cli | grep --color=no "used_memory:" | sed 's/\r//g')
EXPECTED="used_memory:827480"
[ "$FOUND" == "$EXPECTED" ]
}
function test_done()
{
echo "All integration tests passed"
Expand All @@ -134,4 +147,5 @@ test_rsetbit_rgetbit_wrong_arity
test_rbitop
test_bitcount
test_bitpos
test_memory
test_done

0 comments on commit c66ec00

Please sign in to comment.