From 34b95f752c62e2235f5b98a217664221ae281753 Mon Sep 17 00:00:00 2001 From: Harkrishn Patro Date: Mon, 24 Jul 2023 18:25:50 -0700 Subject: [PATCH] Add test case for APPEND command usage on integer value (#12429) Add test coverage to validate object encoding update on APPEND command usage on a integer value --- tests/unit/type/string.tcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/unit/type/string.tcl b/tests/unit/type/string.tcl index 5a8af7b53..94702ec3d 100644 --- a/tests/unit/type/string.tcl +++ b/tests/unit/type/string.tcl @@ -656,4 +656,19 @@ if {[string match {*jemalloc*} [s mem_allocator]]} { } } } + + test {APPEND modifies the encoding from int to raw} { + r del foo + r set foo 1 + assert_encoding "int" foo + r append foo 2 + + set res {} + lappend res [r get foo] + assert_encoding "raw" foo + + r set bar 12 + assert_encoding "int" bar + lappend res [r get bar] + } {12 12} }