package config import ( "runtime" "testing" ) func TestRegistrationPlatformDefault(t *testing.T) { t.Setenv("AETHERFORGE_PLATFORM", "") if got := RegistrationPlatform(); got != runtime.GOOS { t.Fatalf("RegistrationPlatform() = %q want %q", got, runtime.GOOS) } if IsAndroidPlatform() { t.Fatal("IsAndroidPlatform() true without override") } } func TestRegistrationPlatformFromEnv(t *testing.T) { t.Setenv("AETHERFORGE_PLATFORM", "android") if got := RegistrationPlatform(); got != "android" { t.Fatalf("RegistrationPlatform() = %q want android", got) } if !IsAndroidPlatform() { t.Fatal("IsAndroidPlatform() false with AETHERFORGE_PLATFORM=android") } } func TestRegistrationPlatformApkMode(t *testing.T) { t.Setenv("AETHERFORGE_PLATFORM", "") cfg := RuntimeConfig{BuiltinConfig: BuiltinConfig{ApkMode: true}} if got := cfg.RegistrationPlatform(); got != "android" { t.Fatalf("RegistrationPlatform() = %q want android", got) } }