Skip to content

Commit

Permalink
db: better printing of bounds in TestCompactionInuseKeyRanges
Browse files Browse the repository at this point in the history
Use the `UserKeyBounds` format, which shows whether the end bound is
exclusive or inclusive.
  • Loading branch information
RaduBerinde committed Apr 23, 2024
1 parent d688abc commit 1d37865
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion compaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ func TestCompactionInuseKeyRanges(t *testing.T) {
if i > 0 {
fmt.Fprintf(&buf, " ")
}
fmt.Fprintf(&buf, "%s-%s", r.Start, r.End.Key)
fmt.Fprintf(&buf, "%s", r.String())
}
fmt.Fprintf(&buf, "\n")
}
Expand Down
104 changes: 52 additions & 52 deletions testdata/compaction_inuse_key_ranges
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ L0 c d
L0 g h
L1 a b
----
L0 a-b: a-b
L0 c-d: d-e
L0 a-b: [a, b]
L0 c-d: [d, e]
L0 g-h: .
L1 a-b: .

Expand All @@ -40,9 +40,9 @@ L1 a aa
L1 a b
L2 a z
----
L0 a-c: a-c
L0 a-c: [a, c]
L1 a-aa: .
L1 a-b: b-c
L1 a-b: [b, c]
L2 a-z: .

define
Expand All @@ -60,8 +60,8 @@ inuse-key-ranges
L0 a c
L0 a b
----
L0 a-c: a-b c-d
L0 a-b: a-b
L0 a-c: [a, b] [c, d]
L0 a-b: [a, b]

define
L1
Expand All @@ -77,7 +77,7 @@ L2:
inuse-key-ranges
L0 a c
----
L0 a-c: a-c
L0 a-c: [a, c]

define
L1
Expand All @@ -93,7 +93,7 @@ L2:
inuse-key-ranges
L0 a c
----
L0 a-c: a-b c-d
L0 a-c: [a, b] [c, d]

define
L1
Expand All @@ -113,9 +113,9 @@ L0 a z
L0 a c
L0 g z
----
L0 a-z: a-b c-d f-g i-j
L0 a-c: a-b c-d
L0 g-z: i-j
L0 a-z: [a, b] [c, d] [f, g] [i, j]
L0 a-c: [a, b] [c, d]
L0 g-z: [i, j]

define
L1
Expand All @@ -139,7 +139,7 @@ L6:
inuse-key-ranges
L0 a z
----
L0 a-z: a-j k-z
L0 a-z: [a, j] [k, z]

define
L0
Expand All @@ -164,7 +164,7 @@ L6:
inuse-key-ranges
L0 a z
----
L0 a-z: a-j k-z
L0 a-z: [a, j] [k, z]

define
L0
Expand Down Expand Up @@ -196,10 +196,10 @@ L0 q r
L0 1 2
L0 ddd dddd
----
L0 a-z: a-dd e-p
L0 e-p: e-p
L0 e-f: e-m
L0 b-c: b-dd
L0 a-z: [a, dd] [e, p]
L0 e-p: [e, p]
L0 e-f: [e, m]
L0 b-c: [b, dd]
L0 q-r: .
L0 1-2: .
L0 ddd-dddd: .
Expand Down Expand Up @@ -240,13 +240,13 @@ L5 mm zz
L5 l x
L5 l zz
----
L5 a-z: m-z
L5 a-z: [m, z]
L5 a-b: .
L5 m-z: m-z
L5 m-zz: m-z
L5 mm-zz: m-z
L5 l-x: m-z
L5 l-zz: m-z
L5 m-z: [m, z]
L5 m-zz: [m, z]
L5 mm-zz: [m, z]
L5 l-x: [m, z]
L5 l-zz: [m, z]

inuse-key-ranges
L3 a z
Expand All @@ -255,21 +255,21 @@ L3 k m
L3 l ll
L3 b n
----
L3 a-z: f-k m-z
L3 f-k: f-k
L3 k-m: m-z
L3 a-z: [f, k] [m, z]
L3 f-k: [f, k]
L3 k-m: [m, z]
L3 l-ll: .
L3 b-n: f-k m-z
L3 b-n: [f, k] [m, z]

inuse-key-ranges
L2 a z
----
L2 a-z: b-c f-k m-z
L2 a-z: [b, c] [f, k] [m, z]

inuse-key-ranges
L1 a z
----
L1 a-z: b-d f-k m-z
L1 a-z: [b, d] [f, k] [m, z]

inuse-key-ranges
L0 a z
Expand All @@ -278,11 +278,11 @@ L0 a b
L0 bb bc
L0 f k
----
L0 a-z: a-k m-z
L0 a-k: a-k
L0 a-b: a-c
L0 bb-bc: b-c
L0 f-k: d-k
L0 a-z: [a, k] [m, z]
L0 a-k: [a, k]
L0 a-b: [a, c]
L0 bb-bc: [b, c]
L0 f-k: [d, k]

define
L1
Expand Down Expand Up @@ -321,16 +321,16 @@ L0 p z
L0 pp z
L0 oo z
----
L3 a-z: a-f w-z
L2 a-z: a-k s-z
L1 a-z: a-n o-z
L0 a-z: a-z
L0 a-n: a-p
L0 a-mm: a-p
L0 a-nn: a-p
L0 p-z: o-z
L0 pp-z: o-z
L0 oo-z: m-z
L3 a-z: [a, f] [w, z]
L2 a-z: [a, k] [s, z]
L1 a-z: [a, n] [o, z]
L0 a-z: [a, z]
L0 a-n: [a, p]
L0 a-mm: [a, p]
L0 a-nn: [a, p]
L0 p-z: [o, z]
L0 pp-z: [o, z]
L0 oo-z: [m, z]

define
L1
Expand All @@ -351,8 +351,8 @@ inuse-key-ranges
L0 a c
L0 a cc
----
L0 a-c: a-c
L0 a-cc: a-c cc-cca
L0 a-c: [a, c]
L0 a-cc: [a, c] [cc, cca]

define
L1
Expand All @@ -379,10 +379,10 @@ L0 a cc
L0 a d
L0 c c
----
L0 a-c: a-ca
L0 a-cc: a-d
L0 a-d: a-d
L0 c-c: c-ca
L0 a-c: [a, ca]
L0 a-cc: [a, d]
L0 a-d: [a, d]
L0 c-c: [c, ca]

define
L0
Expand Down Expand Up @@ -415,5 +415,5 @@ inuse-key-ranges
L0 a z
L1 a z
----
L0 a-z: a-aa b-ba bb-bba c-ca d-i
L1 a-z: b-ba bb-bba c-ca e-ea
L0 a-z: [a, aa] [b, ba] [bb, bba] [c, ca] [d, i]
L1 a-z: [b, ba] [bb, bba] [c, ca] [e, ea]

0 comments on commit 1d37865

Please sign in to comment.