Last night I restarted my work on relative redirects in
HTTPClientFactory (Ticket #3384). What I had forgotten was how
insanely difficult it is to write the test cases, which would then be
significantly more bug prone than the code itself. The problem is that
for every possible input I need to add (1) A test_* function, (2) a
callback, (3) one or more children to the internal web server for the
test_* function to connect to.
This morning I hit on another idea: Why not separate the code in
HTTPClientFactory that does the fix into a separate function? Then
there could be one test case to make sure the code in
HTTPClientFactory works, then a single test case that contains a
series of assertEquals that test the output of the function. How does
that sound? Should I put it outside of HTTPClientFactory or inside?