package platform

import (
	"testing"
)

// TestIsWindows tests Windows platform detection
func TestIsWindows(t *testing.T) {
	tests := []struct {
		name   string
		osType OSType
		want   bool
	}{
		{
			name:   "Windows platform",
			osType: Windows,
			want:   true,
		},
		{
			name:   "Darwin platform",
			osType: Darwin,
			want:   false,
		},
		{
			name:   "Linux platform",
			osType: Linux,
			want:   false,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			p := &Platform{OSType: tt.osType}
			if got := p.IsWindows(); got != tt.want {
				t.Errorf("IsWindows() = %v, want %v", got, tt.want)
			}
		})
	}
}

// TestIsDarwin tests macOS platform detection
func TestIsDarwin(t *testing.T) {
	tests := []struct {
		name   string
		osType OSType
		want   bool
	}{
		{
			name:   "Darwin platform",
			osType: Darwin,
			want:   true,
		},
		{
			name:   "Windows platform",
			osType: Windows,
			want:   false,
		},
		{
			name:   "Linux platform",
			osType: Linux,
			want:   false,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			p := &Platform{OSType: tt.osType}
			if got := p.IsDarwin(); got != tt.want {
				t.Errorf("IsDarwin() = %v, want %v", got, tt.want)
			}
		})
	}
}

// TestIsLinux tests Linux platform detection
func TestIsLinux(t *testing.T) {
	tests := []struct {
		name   string
		osType OSType
		want   bool
	}{
		{
			name:   "Linux platform",
			osType: Linux,
			want:   true,
		},
		{
			name:   "Darwin platform",
			osType: Darwin,
			want:   false,
		},
		{
			name:   "Windows platform",
			osType: Windows,
			want:   false,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			p := &Platform{OSType: tt.osType}
			if got := p.IsLinux(); got != tt.want {
				t.Errorf("IsLinux() = %v, want %v", got, tt.want)
			}
		})
	}
}
