TestVoidProcessorEdgeCases tests edge cases for void processor
(t *testing.T)
| 799 | |
| 800 | // TestVoidProcessorEdgeCases tests edge cases for void processor |
| 801 | func TestVoidProcessorEdgeCases(t *testing.T) { |
| 802 | t.Run("VoidProcessorMultipleOperations", func(t *testing.T) { |
| 803 | processor := NewVoidProcessor() |
| 804 | handler := NewTestHandler("test") |
| 805 | |
| 806 | // Multiple register attempts should all fail |
| 807 | for i := 0; i < 5; i++ { |
| 808 | err := processor.RegisterHandler(fmt.Sprintf("TEST_%d", i), handler, false) |
| 809 | if err == nil { |
| 810 | t.Errorf("VoidProcessor RegisterHandler should always return error") |
| 811 | } |
| 812 | } |
| 813 | |
| 814 | // Multiple unregister attempts should all fail |
| 815 | for i := 0; i < 5; i++ { |
| 816 | err := processor.UnregisterHandler(fmt.Sprintf("TEST_%d", i)) |
| 817 | if err == nil { |
| 818 | t.Errorf("VoidProcessor UnregisterHandler should always return error") |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | // Multiple get attempts should all return nil |
| 823 | for i := 0; i < 5; i++ { |
| 824 | handler := processor.GetHandler(fmt.Sprintf("TEST_%d", i)) |
| 825 | if handler != nil { |
| 826 | t.Errorf("VoidProcessor GetHandler should always return nil") |
| 827 | } |
| 828 | } |
| 829 | }) |
| 830 | } |
| 831 | |
| 832 | // Helper functions to create fake RESP3 protocol data for testing |
| 833 |
nothing calls this directly
no test coverage detected