package utils import ( "github.com/stretchr/testify/assert" "testing" ) func TestQuotedStringToArray(t *testing.T) { assert.Equal(t, []string{"hello", "world"}, QuotedStringToArray("hello world")) assert.Equal(t, []string{"hello world"}, QuotedStringToArray("\"hello world\"")) assert.Equal(t, []string{"test", "hello world", "message"}, QuotedStringToArray("test \"hello world\" message")) assert.Equal(t, []string{"test", "hello world \"with extra data\" inside", "message"}, QuotedStringToArray("test \"hello world \\\"with extra data\\\" inside\" message")) assert.Equal(t, []string{"hello world"}, QuotedStringToArray("hello\\ world")) assert.Equal(t, []string{"test", "hello world", "message"}, QuotedStringToArray("test hello\\ world message")) }