diff --git a/bigtable/bigtable.go b/bigtable/bigtable.go index b3fbefa8aa8f..9789cb854343 100644 --- a/bigtable/bigtable.go +++ b/bigtable/bigtable.go @@ -624,9 +624,9 @@ func (r RowRange) String() string { var endStr string switch r.endBound { case rangeOpen: - endStr = r.end + ")" + endStr = strconv.Quote(r.end) + ")" case rangeClosed: - endStr = r.end + "]" + endStr = strconv.Quote(r.end) + "]" case rangeUnbounded: endStr = "∞)" } diff --git a/bigtable/bigtable_test.go b/bigtable/bigtable_test.go index 0f63b6346f16..7c204f369bef 100644 --- a/bigtable/bigtable_test.go +++ b/bigtable/bigtable_test.go @@ -513,22 +513,22 @@ func TestRowRangeString(t *testing.T) { { desc: "RowRange closed open", rr: NewClosedOpenRange("a", "b"), - str: "[\"a\",b)", + str: "[\"a\",\"b\")", }, { desc: "RowRange open open", rr: NewOpenRange("c", "d"), - str: "(\"c\",d)", + str: "(\"c\",\"d\")", }, { desc: "RowRange closed closed", rr: NewClosedRange("e", "f"), - str: "[\"e\",f]", + str: "[\"e\",\"f\"]", }, { desc: "RowRange open closed", rr: NewOpenClosedRange("g", "h"), - str: "(\"g\",h]", + str: "(\"g\",\"h\"]", }, { desc: "RowRange unbound unbound", @@ -543,7 +543,7 @@ func TestRowRangeString(t *testing.T) { { desc: "RowRange unbound closed", rr: InfiniteReverseRange("c"), - str: "(∞,c]", + str: "(∞,\"c\"]", }, } { t.Run(test.desc, func(t *testing.T) {