Skip to content

Commit

Permalink
add docs to sanitize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ninedraft committed Dec 9, 2024
1 parent 25a4bd3 commit 2f3ae5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/sanitize/sanitize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ func TestQuoteString(t *testing.T) {
tc("with quotes", `one's hat is always a cat`)
}

// This function was used before optimizations.
// You should keep for testing purposes - we want to ensure there are no breaking changes.
func oldQuoteString(str string) string {
return "'" + strings.ReplaceAll(str, "'", "''") + "'"
}
Expand All @@ -274,6 +276,8 @@ func TestQuoteBytes(t *testing.T) {
tc("text", []byte("abcd"))
}

// This function was used before optimizations.
// You should keep for testing purposes - we want to ensure there are no breaking changes.
func oldQuoteBytes(buf []byte) string {
return `'\x` + hex.EncodeToString(buf) + "'"
}

0 comments on commit 2f3ae5a

Please sign in to comment.