|
387 | 387 | }
|
388 | 388 | }
|
389 | 389 |
|
| 390 | + func testEnum_Empty_AccessControl_Package() { |
| 391 | + assertMacro { |
| 392 | + """ |
| 393 | + @Reducer |
| 394 | + package enum Destination { |
| 395 | + } |
| 396 | + """ |
| 397 | + } expansion: { |
| 398 | + """ |
| 399 | + package enum Destination { |
| 400 | +
|
| 401 | + @CasePathable |
| 402 | + @dynamicMemberLookup |
| 403 | + @ObservableState |
| 404 | +
|
| 405 | + package enum State: ComposableArchitecture.CaseReducerState { |
| 406 | +
|
| 407 | + package typealias StateReducer = Destination |
| 408 | +
|
| 409 | + } |
| 410 | +
|
| 411 | + @CasePathable |
| 412 | +
|
| 413 | + package enum Action { |
| 414 | +
|
| 415 | + } |
| 416 | +
|
| 417 | + @ComposableArchitecture.ReducerBuilder<Self.State, Self.Action> |
| 418 | +
|
| 419 | + package static var body: ComposableArchitecture.EmptyReducer<Self.State, Self.Action> { |
| 420 | + ComposableArchitecture.EmptyReducer<Self.State, Self.Action>() |
| 421 | + } |
| 422 | +
|
| 423 | + package enum CaseScope { |
| 424 | +
|
| 425 | + } |
| 426 | +
|
| 427 | + package static func scope(_ store: ComposableArchitecture.Store<Self.State, Self.Action>) -> CaseScope { |
| 428 | + switch store.state { |
| 429 | +
|
| 430 | + } |
| 431 | + } |
| 432 | + } |
| 433 | +
|
| 434 | + extension Destination: ComposableArchitecture.CaseReducer, ComposableArchitecture.Reducer { |
| 435 | + } |
| 436 | + """ |
| 437 | + } |
| 438 | + } |
| 439 | + |
| 440 | + func testEnum_Empty_AccessControl_Public() { |
| 441 | + assertMacro { |
| 442 | + """ |
| 443 | + @Reducer |
| 444 | + public enum Destination { |
| 445 | + } |
| 446 | + """ |
| 447 | + } expansion: { |
| 448 | + """ |
| 449 | + public enum Destination { |
| 450 | +
|
| 451 | + @CasePathable |
| 452 | + @dynamicMemberLookup |
| 453 | + @ObservableState |
| 454 | +
|
| 455 | + public enum State: ComposableArchitecture.CaseReducerState { |
| 456 | +
|
| 457 | + public typealias StateReducer = Destination |
| 458 | +
|
| 459 | + } |
| 460 | +
|
| 461 | + @CasePathable |
| 462 | +
|
| 463 | + public enum Action { |
| 464 | +
|
| 465 | + } |
| 466 | +
|
| 467 | + @ComposableArchitecture.ReducerBuilder<Self.State, Self.Action> |
| 468 | +
|
| 469 | + public static var body: ComposableArchitecture.EmptyReducer<Self.State, Self.Action> { |
| 470 | + ComposableArchitecture.EmptyReducer<Self.State, Self.Action>() |
| 471 | + } |
| 472 | +
|
| 473 | + public enum CaseScope { |
| 474 | +
|
| 475 | + } |
| 476 | +
|
| 477 | + public static func scope(_ store: ComposableArchitecture.Store<Self.State, Self.Action>) -> CaseScope { |
| 478 | + switch store.state { |
| 479 | +
|
| 480 | + } |
| 481 | + } |
| 482 | + } |
| 483 | +
|
| 484 | + extension Destination: ComposableArchitecture.CaseReducer, ComposableArchitecture.Reducer { |
| 485 | + } |
| 486 | + """ |
| 487 | + } |
| 488 | + } |
| 489 | + |
390 | 490 | func testEnum_OneAlertCase() {
|
391 | 491 | assertMacro {
|
392 | 492 | """
|
|
0 commit comments