From e02dcb943263da2fa701a7aba96b5dc41c14ffe0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 19 Oct 2024 21:02:14 +0300 Subject: fix linkedin escapes --- internal/platforms/linkedin/escapes_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 internal/platforms/linkedin/escapes_test.go (limited to 'internal/platforms/linkedin/escapes_test.go') diff --git a/internal/platforms/linkedin/escapes_test.go b/internal/platforms/linkedin/escapes_test.go new file mode 100644 index 0000000..b1f9203 --- /dev/null +++ b/internal/platforms/linkedin/escapes_test.go @@ -0,0 +1,15 @@ +package linkedin + +import ( + "testing" +) + +func TestLinkedInEscapes(t *testing.T) { + var ( + input = `This is a test message with special characters: " {} @ [] () <> # \ * _ ~ |` + expected = `This is a test message with special characters: \" \{\} @ \[\] \(\) \<\> # \\ \* \_ \~ \|` + ) + if escaped := escapeLinkedInText(input); escaped != expected { + t.Errorf("expected '%s' but got '%s'", expected, escaped) + } +} -- cgit v1.2.3