package rest

import (
	"testing"

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

// ---------------------------------------------------------------------------
// sanitizeDeveloperName — pure function
// ---------------------------------------------------------------------------

func TestSanitizeDeveloperName(t *testing.T) {
	tests := []struct {
		name     string
		label    string
		expected string
	}{
		{"simple label", "My Flow", "My_Flow"},
		{"with hyphens", "Test-Flow", "Test_Flow"},
		{"alphanumeric", "Flow123", "Flow123"},
		{"special characters", "Flow@#$Name!", "FlowName"},
		{"empty string", "", "Flow"},
		{"spaces only", "   ", "___"},
		{"mixed", "My Cool-Flow 2024!", "My_Cool_Flow_2024"},
	}

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