From 2f3ae5a6dcf3013a30f98691a22ed2844bef7ff7 Mon Sep 17 00:00:00 2001 From: merlin Date: Tue, 1 Oct 2024 17:15:38 +0300 Subject: [PATCH] add docs to sanitize tests --- internal/sanitize/sanitize_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/sanitize/sanitize_test.go b/internal/sanitize/sanitize_test.go index 9da701ea9..926751534 100644 --- a/internal/sanitize/sanitize_test.go +++ b/internal/sanitize/sanitize_test.go @@ -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, "'", "''") + "'" } @@ -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) + "'" }