Skip to content

Commit 142b153

Browse files
authored
fix(bigtable): Add quotes to end of range (#10488)
1 parent 0d0e5dd commit 142b153

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

bigtable/bigtable.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@ func (r RowRange) String() string {
624624
var endStr string
625625
switch r.endBound {
626626
case rangeOpen:
627-
endStr = r.end + ")"
627+
endStr = strconv.Quote(r.end) + ")"
628628
case rangeClosed:
629-
endStr = r.end + "]"
629+
endStr = strconv.Quote(r.end) + "]"
630630
case rangeUnbounded:
631631
endStr = "∞)"
632632
}

bigtable/bigtable_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -513,22 +513,22 @@ func TestRowRangeString(t *testing.T) {
513513
{
514514
desc: "RowRange closed open",
515515
rr: NewClosedOpenRange("a", "b"),
516-
str: "[\"a\",b)",
516+
str: "[\"a\",\"b\")",
517517
},
518518
{
519519
desc: "RowRange open open",
520520
rr: NewOpenRange("c", "d"),
521-
str: "(\"c\",d)",
521+
str: "(\"c\",\"d\")",
522522
},
523523
{
524524
desc: "RowRange closed closed",
525525
rr: NewClosedRange("e", "f"),
526-
str: "[\"e\",f]",
526+
str: "[\"e\",\"f\"]",
527527
},
528528
{
529529
desc: "RowRange open closed",
530530
rr: NewOpenClosedRange("g", "h"),
531-
str: "(\"g\",h]",
531+
str: "(\"g\",\"h\"]",
532532
},
533533
{
534534
desc: "RowRange unbound unbound",
@@ -543,7 +543,7 @@ func TestRowRangeString(t *testing.T) {
543543
{
544544
desc: "RowRange unbound closed",
545545
rr: InfiniteReverseRange("c"),
546-
str: "(∞,c]",
546+
str: "(∞,\"c\"]",
547547
},
548548
} {
549549
t.Run(test.desc, func(t *testing.T) {

0 commit comments

Comments
 (0)