package repositories

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestEscapeLikeWildcards(t *testing.T) {
	tests := []struct {
		name     string
		input    string
		expected string
	}{
		{"no wildcards", "hello", "hello"},
		{"percent sign", "50% off", "50\\% off"},
		{"underscore", "user_name", "user\\_name"},
		{"both wildcards", "50%_off", "50\\%\\_off"},
		{"empty string", "", ""},
		{"only wildcards", "%_", "\\%\\_"},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			result := escapeLikeWildcards(tt.input)
			assert.Equal(t, tt.expected, result)
		})
	}
}
