From c66ec0065adb46f2797c4ef6836a8c0e54c731bb Mon Sep 17 00:00:00 2001 From: Antonio Viggiano Date: Sat, 20 May 2017 15:14:38 -0300 Subject: [PATCH] Add memory integration tests Will use them to confirm allocation override changes redis memory report (#2) --- tests/integration.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration.sh b/tests/integration.sh index fb14a76..d96d328 100755 --- a/tests/integration.sh +++ b/tests/integration.sh @@ -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" @@ -134,4 +147,5 @@ test_rsetbit_rgetbit_wrong_arity test_rbitop test_bitcount test_bitpos +test_memory test_done \ No newline at end of file