(t *testing.T)
| 485 | } |
| 486 | |
| 487 | func TestAutoImportStyleNormalization(t *testing.T) { |
| 488 | opts := &etscore.EffectPluginOptions{ |
| 489 | NamespaceImportPackages: []string{"Effect", " @Effect/Platform ", ""}, |
| 490 | BarrelImportPackages: []string{"@Effect/Schema", " EFFECT/SQL "}, |
| 491 | ImportAliases: map[string]string{ |
| 492 | "Effect": "E", |
| 493 | " @Effect/Platform ": "Platform", |
| 494 | "": "Invalid", |
| 495 | }, |
| 496 | TopLevelNamedReexports: etscore.TopLevelNamedReexportsMode("FOLLOW"), |
| 497 | } |
| 498 | |
| 499 | if got, want := opts.GetNamespaceImportPackages(), []string{"effect", "@effect/platform"}; !reflect.DeepEqual(got, want) { |
| 500 | t.Errorf("GetNamespaceImportPackages() = %v, want %v", got, want) |
| 501 | } |
| 502 | if got, want := opts.GetBarrelImportPackages(), []string{"@effect/schema", "effect/sql"}; !reflect.DeepEqual(got, want) { |
| 503 | t.Errorf("GetBarrelImportPackages() = %v, want %v", got, want) |
| 504 | } |
| 505 | if got, want := opts.GetImportAliases(), map[string]string{"effect": "E", "@effect/platform": "Platform"}; !reflect.DeepEqual(got, want) { |
| 506 | t.Errorf("GetImportAliases() = %v, want %v", got, want) |
| 507 | } |
| 508 | if got := opts.GetTopLevelNamedReexports(); got != etscore.TopLevelNamedReexportsFollow { |
| 509 | t.Errorf("GetTopLevelNamedReexports() = %q, want %q", got, etscore.TopLevelNamedReexportsFollow) |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | func TestTopLevelNamedReexportsInvalidFallback(t *testing.T) { |
| 514 | opts := &etscore.EffectPluginOptions{TopLevelNamedReexports: etscore.TopLevelNamedReexportsMode("invalid")} |
nothing calls this directly
no test coverage detected