(t *testing.T)
| 904 | } |
| 905 | |
| 906 | func TestStreamErrorStatus(t *testing.T) { |
| 907 | t.Parallel() |
| 908 | |
| 909 | t.Run("CancellationBecomesInterrupted", func(t *testing.T) { |
| 910 | t.Parallel() |
| 911 | require.Equal(t, StatusInterrupted, streamErrorStatus(StatusCompleted, context.Canceled)) |
| 912 | }) |
| 913 | |
| 914 | t.Run("DeadlineExceededBecomesInterrupted", func(t *testing.T) { |
| 915 | t.Parallel() |
| 916 | require.Equal(t, StatusInterrupted, streamErrorStatus(StatusCompleted, context.DeadlineExceeded)) |
| 917 | }) |
| 918 | |
| 919 | t.Run("NilErrorBecomesError", func(t *testing.T) { |
| 920 | t.Parallel() |
| 921 | require.Equal(t, StatusError, streamErrorStatus(StatusCompleted, nil)) |
| 922 | }) |
| 923 | |
| 924 | t.Run("ExistingErrorWins", func(t *testing.T) { |
| 925 | t.Parallel() |
| 926 | require.Equal(t, StatusError, streamErrorStatus(StatusError, context.Canceled)) |
| 927 | }) |
| 928 | } |
| 929 | |
| 930 | func objectPartsToSeq(parts []fantasy.ObjectStreamPart) fantasy.ObjectStreamResponse { |
| 931 | return func(yield func(fantasy.ObjectStreamPart) bool) { |
nothing calls this directly
no test coverage detected