WWW::Link::Test - adaptive functions for testing links.
use WWW::Link::Test $ua=create_a_user_agent(); $link=get_a_link_object(); WWW::Link::Test::test_link($ua, $link);
The adaptive tester uses either a simple or a complex tester depending on which one has been working correctly.
This function tests a link by going out to the world and checking it and then telling the associated link object what happened.
The link tester has recieved a response, now the question is what do we do with it. It depends on our testing mode.
This verifies that the given link has a useful test cookie, and gives it an appropriate one if it doesn't.
We have two different ways of testing. One us network efficient, but is less likely to give a fully correct answer. The other is less network efficient, but more tests more carefully.
We assume that the complex testing system is correct. We will allow the simple testing system to be used only as long as we have no reason to suspect inaccuracy we will test with the simple tester.
Every now and then (after 20 tests) we will verify that our method of testing is consistent. We do this by trying simple then complex testing in order. If they are inconsistent then we finally try simple testing one more time then mark the simple testing as wrong.
If a link changes status then we will try to verify it sooner..
There are two flags that can be set.
OKAY_SIMPLE_WORKING - link tests correctly with both complex and simple testers when it is working.
OKAY_SIMPLE_BROKEN- link tests correctly with both complex and simple testers when it is broken.
As long as these are both set then most of our testing should be done in simple mode.