...

Source file src/github.com/go-kit/kit/transport/http/intercepting_writer_test.go

Documentation: github.com/go-kit/kit/transport/http

     1  package http
     2  
     3  import (
     4  	"bufio"
     5  	"io"
     6  	"net"
     7  	"net/http"
     8  	"testing"
     9  )
    10  
    11  type versatileWriter struct {
    12  	http.ResponseWriter
    13  	closeNotifyCalled bool
    14  	hijackCalled      bool
    15  	readFromCalled    bool
    16  	pushCalled        bool
    17  	flushCalled       bool
    18  }
    19  
    20  func (v *versatileWriter) Flush() { v.flushCalled = true }
    21  func (v *versatileWriter) Push(target string, opts *http.PushOptions) error {
    22  	v.pushCalled = true
    23  	return nil
    24  }
    25  func (v *versatileWriter) ReadFrom(r io.Reader) (n int64, err error) {
    26  	v.readFromCalled = true
    27  	return 0, nil
    28  }
    29  func (v *versatileWriter) CloseNotify() <-chan bool { v.closeNotifyCalled = true; return nil }
    30  func (v *versatileWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
    31  	v.hijackCalled = true
    32  	return nil, nil, nil
    33  }
    34  
    35  func TestInterceptingWriter_passthroughs(t *testing.T) {
    36  	w := &versatileWriter{}
    37  	iw := (&interceptingWriter{ResponseWriter: w}).reimplementInterfaces()
    38  	iw.(http.Flusher).Flush()
    39  	iw.(http.Pusher).Push("", nil)
    40  	iw.(http.CloseNotifier).CloseNotify()
    41  	iw.(http.Hijacker).Hijack()
    42  	iw.(io.ReaderFrom).ReadFrom(nil)
    43  
    44  	if !w.flushCalled {
    45  		t.Error("Flush not called")
    46  	}
    47  	if !w.pushCalled {
    48  		t.Error("Push not called")
    49  	}
    50  	if !w.closeNotifyCalled {
    51  		t.Error("CloseNotify not called")
    52  	}
    53  	if !w.hijackCalled {
    54  		t.Error("Hijack not called")
    55  	}
    56  	if !w.readFromCalled {
    57  		t.Error("ReadFrom not called")
    58  	}
    59  }
    60  
    61  // TestInterceptingWriter_reimplementInterfaces is also derived from
    62  // https://github.com/felixge/httpsnoop, like interceptingWriter.
    63  func TestInterceptingWriter_reimplementInterfaces(t *testing.T) {
    64  	// combination 1/32
    65  	{
    66  		t.Log("http.ResponseWriter")
    67  		inner := struct {
    68  			http.ResponseWriter
    69  		}{}
    70  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
    71  		if _, ok := w.(http.ResponseWriter); ok != true {
    72  			t.Error("unexpected interface")
    73  		}
    74  		if _, ok := w.(http.Flusher); ok != false {
    75  			t.Error("unexpected interface")
    76  		}
    77  		if _, ok := w.(http.CloseNotifier); ok != false {
    78  			t.Error("unexpected interface")
    79  		}
    80  		if _, ok := w.(http.Hijacker); ok != false {
    81  			t.Error("unexpected interface")
    82  		}
    83  		if _, ok := w.(io.ReaderFrom); ok != false {
    84  			t.Error("unexpected interface")
    85  		}
    86  		if _, ok := w.(http.Pusher); ok != false {
    87  			t.Error("unexpected interface")
    88  		}
    89  
    90  	}
    91  
    92  	// combination 2/32
    93  	{
    94  		t.Log("http.ResponseWriter, http.Pusher")
    95  		inner := struct {
    96  			http.ResponseWriter
    97  			http.Pusher
    98  		}{}
    99  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   100  		if _, ok := w.(http.ResponseWriter); ok != true {
   101  			t.Error("unexpected interface")
   102  		}
   103  		if _, ok := w.(http.Flusher); ok != false {
   104  			t.Error("unexpected interface")
   105  		}
   106  		if _, ok := w.(http.CloseNotifier); ok != false {
   107  			t.Error("unexpected interface")
   108  		}
   109  		if _, ok := w.(http.Hijacker); ok != false {
   110  			t.Error("unexpected interface")
   111  		}
   112  		if _, ok := w.(io.ReaderFrom); ok != false {
   113  			t.Error("unexpected interface")
   114  		}
   115  		if _, ok := w.(http.Pusher); ok != true {
   116  			t.Error("unexpected interface")
   117  		}
   118  
   119  	}
   120  
   121  	// combination 3/32
   122  	{
   123  		t.Log("http.ResponseWriter, io.ReaderFrom")
   124  		inner := struct {
   125  			http.ResponseWriter
   126  			io.ReaderFrom
   127  		}{}
   128  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   129  		if _, ok := w.(http.ResponseWriter); ok != true {
   130  			t.Error("unexpected interface")
   131  		}
   132  		if _, ok := w.(http.Flusher); ok != false {
   133  			t.Error("unexpected interface")
   134  		}
   135  		if _, ok := w.(http.CloseNotifier); ok != false {
   136  			t.Error("unexpected interface")
   137  		}
   138  		if _, ok := w.(http.Hijacker); ok != false {
   139  			t.Error("unexpected interface")
   140  		}
   141  		if _, ok := w.(io.ReaderFrom); ok != true {
   142  			t.Error("unexpected interface")
   143  		}
   144  		if _, ok := w.(http.Pusher); ok != false {
   145  			t.Error("unexpected interface")
   146  		}
   147  
   148  	}
   149  
   150  	// combination 4/32
   151  	{
   152  		t.Log("http.ResponseWriter, io.ReaderFrom, http.Pusher")
   153  		inner := struct {
   154  			http.ResponseWriter
   155  			io.ReaderFrom
   156  			http.Pusher
   157  		}{}
   158  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   159  		if _, ok := w.(http.ResponseWriter); ok != true {
   160  			t.Error("unexpected interface")
   161  		}
   162  		if _, ok := w.(http.Flusher); ok != false {
   163  			t.Error("unexpected interface")
   164  		}
   165  		if _, ok := w.(http.CloseNotifier); ok != false {
   166  			t.Error("unexpected interface")
   167  		}
   168  		if _, ok := w.(http.Hijacker); ok != false {
   169  			t.Error("unexpected interface")
   170  		}
   171  		if _, ok := w.(io.ReaderFrom); ok != true {
   172  			t.Error("unexpected interface")
   173  		}
   174  		if _, ok := w.(http.Pusher); ok != true {
   175  			t.Error("unexpected interface")
   176  		}
   177  
   178  	}
   179  
   180  	// combination 5/32
   181  	{
   182  		t.Log("http.ResponseWriter, http.Hijacker")
   183  		inner := struct {
   184  			http.ResponseWriter
   185  			http.Hijacker
   186  		}{}
   187  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   188  		if _, ok := w.(http.ResponseWriter); ok != true {
   189  			t.Error("unexpected interface")
   190  		}
   191  		if _, ok := w.(http.Flusher); ok != false {
   192  			t.Error("unexpected interface")
   193  		}
   194  		if _, ok := w.(http.CloseNotifier); ok != false {
   195  			t.Error("unexpected interface")
   196  		}
   197  		if _, ok := w.(http.Hijacker); ok != true {
   198  			t.Error("unexpected interface")
   199  		}
   200  		if _, ok := w.(io.ReaderFrom); ok != false {
   201  			t.Error("unexpected interface")
   202  		}
   203  		if _, ok := w.(http.Pusher); ok != false {
   204  			t.Error("unexpected interface")
   205  		}
   206  
   207  	}
   208  
   209  	// combination 6/32
   210  	{
   211  		t.Log("http.ResponseWriter, http.Hijacker, http.Pusher")
   212  		inner := struct {
   213  			http.ResponseWriter
   214  			http.Hijacker
   215  			http.Pusher
   216  		}{}
   217  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   218  		if _, ok := w.(http.ResponseWriter); ok != true {
   219  			t.Error("unexpected interface")
   220  		}
   221  		if _, ok := w.(http.Flusher); ok != false {
   222  			t.Error("unexpected interface")
   223  		}
   224  		if _, ok := w.(http.CloseNotifier); ok != false {
   225  			t.Error("unexpected interface")
   226  		}
   227  		if _, ok := w.(http.Hijacker); ok != true {
   228  			t.Error("unexpected interface")
   229  		}
   230  		if _, ok := w.(io.ReaderFrom); ok != false {
   231  			t.Error("unexpected interface")
   232  		}
   233  		if _, ok := w.(http.Pusher); ok != true {
   234  			t.Error("unexpected interface")
   235  		}
   236  
   237  	}
   238  
   239  	// combination 7/32
   240  	{
   241  		t.Log("http.ResponseWriter, http.Hijacker, io.ReaderFrom")
   242  		inner := struct {
   243  			http.ResponseWriter
   244  			http.Hijacker
   245  			io.ReaderFrom
   246  		}{}
   247  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   248  		if _, ok := w.(http.ResponseWriter); ok != true {
   249  			t.Error("unexpected interface")
   250  		}
   251  		if _, ok := w.(http.Flusher); ok != false {
   252  			t.Error("unexpected interface")
   253  		}
   254  		if _, ok := w.(http.CloseNotifier); ok != false {
   255  			t.Error("unexpected interface")
   256  		}
   257  		if _, ok := w.(http.Hijacker); ok != true {
   258  			t.Error("unexpected interface")
   259  		}
   260  		if _, ok := w.(io.ReaderFrom); ok != true {
   261  			t.Error("unexpected interface")
   262  		}
   263  		if _, ok := w.(http.Pusher); ok != false {
   264  			t.Error("unexpected interface")
   265  		}
   266  
   267  	}
   268  
   269  	// combination 8/32
   270  	{
   271  		t.Log("http.ResponseWriter, http.Hijacker, io.ReaderFrom, http.Pusher")
   272  		inner := struct {
   273  			http.ResponseWriter
   274  			http.Hijacker
   275  			io.ReaderFrom
   276  			http.Pusher
   277  		}{}
   278  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   279  		if _, ok := w.(http.ResponseWriter); ok != true {
   280  			t.Error("unexpected interface")
   281  		}
   282  		if _, ok := w.(http.Flusher); ok != false {
   283  			t.Error("unexpected interface")
   284  		}
   285  		if _, ok := w.(http.CloseNotifier); ok != false {
   286  			t.Error("unexpected interface")
   287  		}
   288  		if _, ok := w.(http.Hijacker); ok != true {
   289  			t.Error("unexpected interface")
   290  		}
   291  		if _, ok := w.(io.ReaderFrom); ok != true {
   292  			t.Error("unexpected interface")
   293  		}
   294  		if _, ok := w.(http.Pusher); ok != true {
   295  			t.Error("unexpected interface")
   296  		}
   297  
   298  	}
   299  
   300  	// combination 9/32
   301  	{
   302  		t.Log("http.ResponseWriter, http.CloseNotifier")
   303  		inner := struct {
   304  			http.ResponseWriter
   305  			http.CloseNotifier
   306  		}{}
   307  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   308  		if _, ok := w.(http.ResponseWriter); ok != true {
   309  			t.Error("unexpected interface")
   310  		}
   311  		if _, ok := w.(http.Flusher); ok != false {
   312  			t.Error("unexpected interface")
   313  		}
   314  		if _, ok := w.(http.CloseNotifier); ok != true {
   315  			t.Error("unexpected interface")
   316  		}
   317  		if _, ok := w.(http.Hijacker); ok != false {
   318  			t.Error("unexpected interface")
   319  		}
   320  		if _, ok := w.(io.ReaderFrom); ok != false {
   321  			t.Error("unexpected interface")
   322  		}
   323  		if _, ok := w.(http.Pusher); ok != false {
   324  			t.Error("unexpected interface")
   325  		}
   326  
   327  	}
   328  
   329  	// combination 10/32
   330  	{
   331  		t.Log("http.ResponseWriter, http.CloseNotifier, http.Pusher")
   332  		inner := struct {
   333  			http.ResponseWriter
   334  			http.CloseNotifier
   335  			http.Pusher
   336  		}{}
   337  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   338  		if _, ok := w.(http.ResponseWriter); ok != true {
   339  			t.Error("unexpected interface")
   340  		}
   341  		if _, ok := w.(http.Flusher); ok != false {
   342  			t.Error("unexpected interface")
   343  		}
   344  		if _, ok := w.(http.CloseNotifier); ok != true {
   345  			t.Error("unexpected interface")
   346  		}
   347  		if _, ok := w.(http.Hijacker); ok != false {
   348  			t.Error("unexpected interface")
   349  		}
   350  		if _, ok := w.(io.ReaderFrom); ok != false {
   351  			t.Error("unexpected interface")
   352  		}
   353  		if _, ok := w.(http.Pusher); ok != true {
   354  			t.Error("unexpected interface")
   355  		}
   356  
   357  	}
   358  
   359  	// combination 11/32
   360  	{
   361  		t.Log("http.ResponseWriter, http.CloseNotifier, io.ReaderFrom")
   362  		inner := struct {
   363  			http.ResponseWriter
   364  			http.CloseNotifier
   365  			io.ReaderFrom
   366  		}{}
   367  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   368  		if _, ok := w.(http.ResponseWriter); ok != true {
   369  			t.Error("unexpected interface")
   370  		}
   371  		if _, ok := w.(http.Flusher); ok != false {
   372  			t.Error("unexpected interface")
   373  		}
   374  		if _, ok := w.(http.CloseNotifier); ok != true {
   375  			t.Error("unexpected interface")
   376  		}
   377  		if _, ok := w.(http.Hijacker); ok != false {
   378  			t.Error("unexpected interface")
   379  		}
   380  		if _, ok := w.(io.ReaderFrom); ok != true {
   381  			t.Error("unexpected interface")
   382  		}
   383  		if _, ok := w.(http.Pusher); ok != false {
   384  			t.Error("unexpected interface")
   385  		}
   386  
   387  	}
   388  
   389  	// combination 12/32
   390  	{
   391  		t.Log("http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, http.Pusher")
   392  		inner := struct {
   393  			http.ResponseWriter
   394  			http.CloseNotifier
   395  			io.ReaderFrom
   396  			http.Pusher
   397  		}{}
   398  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   399  		if _, ok := w.(http.ResponseWriter); ok != true {
   400  			t.Error("unexpected interface")
   401  		}
   402  		if _, ok := w.(http.Flusher); ok != false {
   403  			t.Error("unexpected interface")
   404  		}
   405  		if _, ok := w.(http.CloseNotifier); ok != true {
   406  			t.Error("unexpected interface")
   407  		}
   408  		if _, ok := w.(http.Hijacker); ok != false {
   409  			t.Error("unexpected interface")
   410  		}
   411  		if _, ok := w.(io.ReaderFrom); ok != true {
   412  			t.Error("unexpected interface")
   413  		}
   414  		if _, ok := w.(http.Pusher); ok != true {
   415  			t.Error("unexpected interface")
   416  		}
   417  
   418  	}
   419  
   420  	// combination 13/32
   421  	{
   422  		t.Log("http.ResponseWriter, http.CloseNotifier, http.Hijacker")
   423  		inner := struct {
   424  			http.ResponseWriter
   425  			http.CloseNotifier
   426  			http.Hijacker
   427  		}{}
   428  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   429  		if _, ok := w.(http.ResponseWriter); ok != true {
   430  			t.Error("unexpected interface")
   431  		}
   432  		if _, ok := w.(http.Flusher); ok != false {
   433  			t.Error("unexpected interface")
   434  		}
   435  		if _, ok := w.(http.CloseNotifier); ok != true {
   436  			t.Error("unexpected interface")
   437  		}
   438  		if _, ok := w.(http.Hijacker); ok != true {
   439  			t.Error("unexpected interface")
   440  		}
   441  		if _, ok := w.(io.ReaderFrom); ok != false {
   442  			t.Error("unexpected interface")
   443  		}
   444  		if _, ok := w.(http.Pusher); ok != false {
   445  			t.Error("unexpected interface")
   446  		}
   447  
   448  	}
   449  
   450  	// combination 14/32
   451  	{
   452  		t.Log("http.ResponseWriter, http.CloseNotifier, http.Hijacker, http.Pusher")
   453  		inner := struct {
   454  			http.ResponseWriter
   455  			http.CloseNotifier
   456  			http.Hijacker
   457  			http.Pusher
   458  		}{}
   459  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   460  		if _, ok := w.(http.ResponseWriter); ok != true {
   461  			t.Error("unexpected interface")
   462  		}
   463  		if _, ok := w.(http.Flusher); ok != false {
   464  			t.Error("unexpected interface")
   465  		}
   466  		if _, ok := w.(http.CloseNotifier); ok != true {
   467  			t.Error("unexpected interface")
   468  		}
   469  		if _, ok := w.(http.Hijacker); ok != true {
   470  			t.Error("unexpected interface")
   471  		}
   472  		if _, ok := w.(io.ReaderFrom); ok != false {
   473  			t.Error("unexpected interface")
   474  		}
   475  		if _, ok := w.(http.Pusher); ok != true {
   476  			t.Error("unexpected interface")
   477  		}
   478  
   479  	}
   480  
   481  	// combination 15/32
   482  	{
   483  		t.Log("http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom")
   484  		inner := struct {
   485  			http.ResponseWriter
   486  			http.CloseNotifier
   487  			http.Hijacker
   488  			io.ReaderFrom
   489  		}{}
   490  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   491  		if _, ok := w.(http.ResponseWriter); ok != true {
   492  			t.Error("unexpected interface")
   493  		}
   494  		if _, ok := w.(http.Flusher); ok != false {
   495  			t.Error("unexpected interface")
   496  		}
   497  		if _, ok := w.(http.CloseNotifier); ok != true {
   498  			t.Error("unexpected interface")
   499  		}
   500  		if _, ok := w.(http.Hijacker); ok != true {
   501  			t.Error("unexpected interface")
   502  		}
   503  		if _, ok := w.(io.ReaderFrom); ok != true {
   504  			t.Error("unexpected interface")
   505  		}
   506  		if _, ok := w.(http.Pusher); ok != false {
   507  			t.Error("unexpected interface")
   508  		}
   509  
   510  	}
   511  
   512  	// combination 16/32
   513  	{
   514  		t.Log("http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher")
   515  		inner := struct {
   516  			http.ResponseWriter
   517  			http.CloseNotifier
   518  			http.Hijacker
   519  			io.ReaderFrom
   520  			http.Pusher
   521  		}{}
   522  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   523  		if _, ok := w.(http.ResponseWriter); ok != true {
   524  			t.Error("unexpected interface")
   525  		}
   526  		if _, ok := w.(http.Flusher); ok != false {
   527  			t.Error("unexpected interface")
   528  		}
   529  		if _, ok := w.(http.CloseNotifier); ok != true {
   530  			t.Error("unexpected interface")
   531  		}
   532  		if _, ok := w.(http.Hijacker); ok != true {
   533  			t.Error("unexpected interface")
   534  		}
   535  		if _, ok := w.(io.ReaderFrom); ok != true {
   536  			t.Error("unexpected interface")
   537  		}
   538  		if _, ok := w.(http.Pusher); ok != true {
   539  			t.Error("unexpected interface")
   540  		}
   541  
   542  	}
   543  
   544  	// combination 17/32
   545  	{
   546  		t.Log("http.ResponseWriter, http.Flusher")
   547  		inner := struct {
   548  			http.ResponseWriter
   549  			http.Flusher
   550  		}{}
   551  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   552  		if _, ok := w.(http.ResponseWriter); ok != true {
   553  			t.Error("unexpected interface")
   554  		}
   555  		if _, ok := w.(http.Flusher); ok != true {
   556  			t.Error("unexpected interface")
   557  		}
   558  		if _, ok := w.(http.CloseNotifier); ok != false {
   559  			t.Error("unexpected interface")
   560  		}
   561  		if _, ok := w.(http.Hijacker); ok != false {
   562  			t.Error("unexpected interface")
   563  		}
   564  		if _, ok := w.(io.ReaderFrom); ok != false {
   565  			t.Error("unexpected interface")
   566  		}
   567  		if _, ok := w.(http.Pusher); ok != false {
   568  			t.Error("unexpected interface")
   569  		}
   570  
   571  	}
   572  
   573  	// combination 18/32
   574  	{
   575  		t.Log("http.ResponseWriter, http.Flusher, http.Pusher")
   576  		inner := struct {
   577  			http.ResponseWriter
   578  			http.Flusher
   579  			http.Pusher
   580  		}{}
   581  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   582  		if _, ok := w.(http.ResponseWriter); ok != true {
   583  			t.Error("unexpected interface")
   584  		}
   585  		if _, ok := w.(http.Flusher); ok != true {
   586  			t.Error("unexpected interface")
   587  		}
   588  		if _, ok := w.(http.CloseNotifier); ok != false {
   589  			t.Error("unexpected interface")
   590  		}
   591  		if _, ok := w.(http.Hijacker); ok != false {
   592  			t.Error("unexpected interface")
   593  		}
   594  		if _, ok := w.(io.ReaderFrom); ok != false {
   595  			t.Error("unexpected interface")
   596  		}
   597  		if _, ok := w.(http.Pusher); ok != true {
   598  			t.Error("unexpected interface")
   599  		}
   600  
   601  	}
   602  
   603  	// combination 19/32
   604  	{
   605  		t.Log("http.ResponseWriter, http.Flusher, io.ReaderFrom")
   606  		inner := struct {
   607  			http.ResponseWriter
   608  			http.Flusher
   609  			io.ReaderFrom
   610  		}{}
   611  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   612  		if _, ok := w.(http.ResponseWriter); ok != true {
   613  			t.Error("unexpected interface")
   614  		}
   615  		if _, ok := w.(http.Flusher); ok != true {
   616  			t.Error("unexpected interface")
   617  		}
   618  		if _, ok := w.(http.CloseNotifier); ok != false {
   619  			t.Error("unexpected interface")
   620  		}
   621  		if _, ok := w.(http.Hijacker); ok != false {
   622  			t.Error("unexpected interface")
   623  		}
   624  		if _, ok := w.(io.ReaderFrom); ok != true {
   625  			t.Error("unexpected interface")
   626  		}
   627  		if _, ok := w.(http.Pusher); ok != false {
   628  			t.Error("unexpected interface")
   629  		}
   630  
   631  	}
   632  
   633  	// combination 20/32
   634  	{
   635  		t.Log("http.ResponseWriter, http.Flusher, io.ReaderFrom, http.Pusher")
   636  		inner := struct {
   637  			http.ResponseWriter
   638  			http.Flusher
   639  			io.ReaderFrom
   640  			http.Pusher
   641  		}{}
   642  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   643  		if _, ok := w.(http.ResponseWriter); ok != true {
   644  			t.Error("unexpected interface")
   645  		}
   646  		if _, ok := w.(http.Flusher); ok != true {
   647  			t.Error("unexpected interface")
   648  		}
   649  		if _, ok := w.(http.CloseNotifier); ok != false {
   650  			t.Error("unexpected interface")
   651  		}
   652  		if _, ok := w.(http.Hijacker); ok != false {
   653  			t.Error("unexpected interface")
   654  		}
   655  		if _, ok := w.(io.ReaderFrom); ok != true {
   656  			t.Error("unexpected interface")
   657  		}
   658  		if _, ok := w.(http.Pusher); ok != true {
   659  			t.Error("unexpected interface")
   660  		}
   661  
   662  	}
   663  
   664  	// combination 21/32
   665  	{
   666  		t.Log("http.ResponseWriter, http.Flusher, http.Hijacker")
   667  		inner := struct {
   668  			http.ResponseWriter
   669  			http.Flusher
   670  			http.Hijacker
   671  		}{}
   672  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   673  		if _, ok := w.(http.ResponseWriter); ok != true {
   674  			t.Error("unexpected interface")
   675  		}
   676  		if _, ok := w.(http.Flusher); ok != true {
   677  			t.Error("unexpected interface")
   678  		}
   679  		if _, ok := w.(http.CloseNotifier); ok != false {
   680  			t.Error("unexpected interface")
   681  		}
   682  		if _, ok := w.(http.Hijacker); ok != true {
   683  			t.Error("unexpected interface")
   684  		}
   685  		if _, ok := w.(io.ReaderFrom); ok != false {
   686  			t.Error("unexpected interface")
   687  		}
   688  		if _, ok := w.(http.Pusher); ok != false {
   689  			t.Error("unexpected interface")
   690  		}
   691  
   692  	}
   693  
   694  	// combination 22/32
   695  	{
   696  		t.Log("http.ResponseWriter, http.Flusher, http.Hijacker, http.Pusher")
   697  		inner := struct {
   698  			http.ResponseWriter
   699  			http.Flusher
   700  			http.Hijacker
   701  			http.Pusher
   702  		}{}
   703  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   704  		if _, ok := w.(http.ResponseWriter); ok != true {
   705  			t.Error("unexpected interface")
   706  		}
   707  		if _, ok := w.(http.Flusher); ok != true {
   708  			t.Error("unexpected interface")
   709  		}
   710  		if _, ok := w.(http.CloseNotifier); ok != false {
   711  			t.Error("unexpected interface")
   712  		}
   713  		if _, ok := w.(http.Hijacker); ok != true {
   714  			t.Error("unexpected interface")
   715  		}
   716  		if _, ok := w.(io.ReaderFrom); ok != false {
   717  			t.Error("unexpected interface")
   718  		}
   719  		if _, ok := w.(http.Pusher); ok != true {
   720  			t.Error("unexpected interface")
   721  		}
   722  
   723  	}
   724  
   725  	// combination 23/32
   726  	{
   727  		t.Log("http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom")
   728  		inner := struct {
   729  			http.ResponseWriter
   730  			http.Flusher
   731  			http.Hijacker
   732  			io.ReaderFrom
   733  		}{}
   734  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   735  		if _, ok := w.(http.ResponseWriter); ok != true {
   736  			t.Error("unexpected interface")
   737  		}
   738  		if _, ok := w.(http.Flusher); ok != true {
   739  			t.Error("unexpected interface")
   740  		}
   741  		if _, ok := w.(http.CloseNotifier); ok != false {
   742  			t.Error("unexpected interface")
   743  		}
   744  		if _, ok := w.(http.Hijacker); ok != true {
   745  			t.Error("unexpected interface")
   746  		}
   747  		if _, ok := w.(io.ReaderFrom); ok != true {
   748  			t.Error("unexpected interface")
   749  		}
   750  		if _, ok := w.(http.Pusher); ok != false {
   751  			t.Error("unexpected interface")
   752  		}
   753  
   754  	}
   755  
   756  	// combination 24/32
   757  	{
   758  		t.Log("http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, http.Pusher")
   759  		inner := struct {
   760  			http.ResponseWriter
   761  			http.Flusher
   762  			http.Hijacker
   763  			io.ReaderFrom
   764  			http.Pusher
   765  		}{}
   766  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   767  		if _, ok := w.(http.ResponseWriter); ok != true {
   768  			t.Error("unexpected interface")
   769  		}
   770  		if _, ok := w.(http.Flusher); ok != true {
   771  			t.Error("unexpected interface")
   772  		}
   773  		if _, ok := w.(http.CloseNotifier); ok != false {
   774  			t.Error("unexpected interface")
   775  		}
   776  		if _, ok := w.(http.Hijacker); ok != true {
   777  			t.Error("unexpected interface")
   778  		}
   779  		if _, ok := w.(io.ReaderFrom); ok != true {
   780  			t.Error("unexpected interface")
   781  		}
   782  		if _, ok := w.(http.Pusher); ok != true {
   783  			t.Error("unexpected interface")
   784  		}
   785  
   786  	}
   787  
   788  	// combination 25/32
   789  	{
   790  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier")
   791  		inner := struct {
   792  			http.ResponseWriter
   793  			http.Flusher
   794  			http.CloseNotifier
   795  		}{}
   796  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   797  		if _, ok := w.(http.ResponseWriter); ok != true {
   798  			t.Error("unexpected interface")
   799  		}
   800  		if _, ok := w.(http.Flusher); ok != true {
   801  			t.Error("unexpected interface")
   802  		}
   803  		if _, ok := w.(http.CloseNotifier); ok != true {
   804  			t.Error("unexpected interface")
   805  		}
   806  		if _, ok := w.(http.Hijacker); ok != false {
   807  			t.Error("unexpected interface")
   808  		}
   809  		if _, ok := w.(io.ReaderFrom); ok != false {
   810  			t.Error("unexpected interface")
   811  		}
   812  		if _, ok := w.(http.Pusher); ok != false {
   813  			t.Error("unexpected interface")
   814  		}
   815  
   816  	}
   817  
   818  	// combination 26/32
   819  	{
   820  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Pusher")
   821  		inner := struct {
   822  			http.ResponseWriter
   823  			http.Flusher
   824  			http.CloseNotifier
   825  			http.Pusher
   826  		}{}
   827  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   828  		if _, ok := w.(http.ResponseWriter); ok != true {
   829  			t.Error("unexpected interface")
   830  		}
   831  		if _, ok := w.(http.Flusher); ok != true {
   832  			t.Error("unexpected interface")
   833  		}
   834  		if _, ok := w.(http.CloseNotifier); ok != true {
   835  			t.Error("unexpected interface")
   836  		}
   837  		if _, ok := w.(http.Hijacker); ok != false {
   838  			t.Error("unexpected interface")
   839  		}
   840  		if _, ok := w.(io.ReaderFrom); ok != false {
   841  			t.Error("unexpected interface")
   842  		}
   843  		if _, ok := w.(http.Pusher); ok != true {
   844  			t.Error("unexpected interface")
   845  		}
   846  
   847  	}
   848  
   849  	// combination 27/32
   850  	{
   851  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom")
   852  		inner := struct {
   853  			http.ResponseWriter
   854  			http.Flusher
   855  			http.CloseNotifier
   856  			io.ReaderFrom
   857  		}{}
   858  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   859  		if _, ok := w.(http.ResponseWriter); ok != true {
   860  			t.Error("unexpected interface")
   861  		}
   862  		if _, ok := w.(http.Flusher); ok != true {
   863  			t.Error("unexpected interface")
   864  		}
   865  		if _, ok := w.(http.CloseNotifier); ok != true {
   866  			t.Error("unexpected interface")
   867  		}
   868  		if _, ok := w.(http.Hijacker); ok != false {
   869  			t.Error("unexpected interface")
   870  		}
   871  		if _, ok := w.(io.ReaderFrom); ok != true {
   872  			t.Error("unexpected interface")
   873  		}
   874  		if _, ok := w.(http.Pusher); ok != false {
   875  			t.Error("unexpected interface")
   876  		}
   877  
   878  	}
   879  
   880  	// combination 28/32
   881  	{
   882  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, http.Pusher")
   883  		inner := struct {
   884  			http.ResponseWriter
   885  			http.Flusher
   886  			http.CloseNotifier
   887  			io.ReaderFrom
   888  			http.Pusher
   889  		}{}
   890  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   891  		if _, ok := w.(http.ResponseWriter); ok != true {
   892  			t.Error("unexpected interface")
   893  		}
   894  		if _, ok := w.(http.Flusher); ok != true {
   895  			t.Error("unexpected interface")
   896  		}
   897  		if _, ok := w.(http.CloseNotifier); ok != true {
   898  			t.Error("unexpected interface")
   899  		}
   900  		if _, ok := w.(http.Hijacker); ok != false {
   901  			t.Error("unexpected interface")
   902  		}
   903  		if _, ok := w.(io.ReaderFrom); ok != true {
   904  			t.Error("unexpected interface")
   905  		}
   906  		if _, ok := w.(http.Pusher); ok != true {
   907  			t.Error("unexpected interface")
   908  		}
   909  
   910  	}
   911  
   912  	// combination 29/32
   913  	{
   914  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker")
   915  		inner := struct {
   916  			http.ResponseWriter
   917  			http.Flusher
   918  			http.CloseNotifier
   919  			http.Hijacker
   920  		}{}
   921  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   922  		if _, ok := w.(http.ResponseWriter); ok != true {
   923  			t.Error("unexpected interface")
   924  		}
   925  		if _, ok := w.(http.Flusher); ok != true {
   926  			t.Error("unexpected interface")
   927  		}
   928  		if _, ok := w.(http.CloseNotifier); ok != true {
   929  			t.Error("unexpected interface")
   930  		}
   931  		if _, ok := w.(http.Hijacker); ok != true {
   932  			t.Error("unexpected interface")
   933  		}
   934  		if _, ok := w.(io.ReaderFrom); ok != false {
   935  			t.Error("unexpected interface")
   936  		}
   937  		if _, ok := w.(http.Pusher); ok != false {
   938  			t.Error("unexpected interface")
   939  		}
   940  
   941  	}
   942  
   943  	// combination 30/32
   944  	{
   945  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, http.Pusher")
   946  		inner := struct {
   947  			http.ResponseWriter
   948  			http.Flusher
   949  			http.CloseNotifier
   950  			http.Hijacker
   951  			http.Pusher
   952  		}{}
   953  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   954  		if _, ok := w.(http.ResponseWriter); ok != true {
   955  			t.Error("unexpected interface")
   956  		}
   957  		if _, ok := w.(http.Flusher); ok != true {
   958  			t.Error("unexpected interface")
   959  		}
   960  		if _, ok := w.(http.CloseNotifier); ok != true {
   961  			t.Error("unexpected interface")
   962  		}
   963  		if _, ok := w.(http.Hijacker); ok != true {
   964  			t.Error("unexpected interface")
   965  		}
   966  		if _, ok := w.(io.ReaderFrom); ok != false {
   967  			t.Error("unexpected interface")
   968  		}
   969  		if _, ok := w.(http.Pusher); ok != true {
   970  			t.Error("unexpected interface")
   971  		}
   972  
   973  	}
   974  
   975  	// combination 31/32
   976  	{
   977  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom")
   978  		inner := struct {
   979  			http.ResponseWriter
   980  			http.Flusher
   981  			http.CloseNotifier
   982  			http.Hijacker
   983  			io.ReaderFrom
   984  		}{}
   985  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
   986  		if _, ok := w.(http.ResponseWriter); ok != true {
   987  			t.Error("unexpected interface")
   988  		}
   989  		if _, ok := w.(http.Flusher); ok != true {
   990  			t.Error("unexpected interface")
   991  		}
   992  		if _, ok := w.(http.CloseNotifier); ok != true {
   993  			t.Error("unexpected interface")
   994  		}
   995  		if _, ok := w.(http.Hijacker); ok != true {
   996  			t.Error("unexpected interface")
   997  		}
   998  		if _, ok := w.(io.ReaderFrom); ok != true {
   999  			t.Error("unexpected interface")
  1000  		}
  1001  		if _, ok := w.(http.Pusher); ok != false {
  1002  			t.Error("unexpected interface")
  1003  		}
  1004  
  1005  	}
  1006  
  1007  	// combination 32/32
  1008  	{
  1009  		t.Log("http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher")
  1010  		inner := struct {
  1011  			http.ResponseWriter
  1012  			http.Flusher
  1013  			http.CloseNotifier
  1014  			http.Hijacker
  1015  			io.ReaderFrom
  1016  			http.Pusher
  1017  		}{}
  1018  		w := (&interceptingWriter{ResponseWriter: inner}).reimplementInterfaces()
  1019  		if _, ok := w.(http.ResponseWriter); ok != true {
  1020  			t.Error("unexpected interface")
  1021  		}
  1022  		if _, ok := w.(http.Flusher); ok != true {
  1023  			t.Error("unexpected interface")
  1024  		}
  1025  		if _, ok := w.(http.CloseNotifier); ok != true {
  1026  			t.Error("unexpected interface")
  1027  		}
  1028  		if _, ok := w.(http.Hijacker); ok != true {
  1029  			t.Error("unexpected interface")
  1030  		}
  1031  		if _, ok := w.(io.ReaderFrom); ok != true {
  1032  			t.Error("unexpected interface")
  1033  		}
  1034  		if _, ok := w.(http.Pusher); ok != true {
  1035  			t.Error("unexpected interface")
  1036  		}
  1037  
  1038  	}
  1039  }
  1040  

View as plain text