Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
941cdc27
Commit
941cdc27
authored
Aug 15, 2023
by
Oran Agra
Browse files
Merge branch 'unstable' into 7.2 to prepare for 7.2.0 GA
parents
1a589818
f4549d1c
Changes
42
Show whitespace changes
Inline
Side-by-side
tests/unit/type/incr.tcl
View file @
941cdc27
...
...
@@ -182,4 +182,33 @@ start_server {tags {"incr"}} {
r incrbyfloat foo
[
expr double
(
-1
)
/41
]
r get foo
}
{
0
}
foreach cmd
{
"incr"
"decr"
"incrby"
"decrby"
}
{
test
"
$cmd
operation should update encoding from raw to int"
{
set res
{}
set expected
{
1 12
}
if
{[
string match
{
*incr*
}
$cmd
]}
{
lappend expected 13
}
else
{
lappend expected 11
}
r set foo 1
assert_encoding
"int"
foo
lappend res
[
r get foo
]
r append foo 2
assert_encoding
"raw"
foo
lappend res
[
r get foo
]
if
{[
string match
{
*by*
}
$cmd
]}
{
r $cmd foo 1
}
else
{
r $cmd foo
}
assert_encoding
"int"
foo
lappend res
[
r get foo
]
assert_equal $res $expected
}
}
}
tests/unit/type/string.tcl
View file @
941cdc27
...
...
@@ -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
}
}
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment