* Add a setup test for middleware/file
This fix adds a setup test for middleware/file so that there is
a basic coverage for the Corefile processing of middleware/file.
This fix is related to 308 (Will look into it).
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* middleware/file: use helper function for test
Fixup setup_test.go and use the test.TempFile function to make things
somewhat shorter.
Use clean up the use of testing.T in TempFile - it is not used.
Make the cache memory bounded, by using a LRU cache. Also split the
cache in a positive and negative one - each with its own controls.
Extend the cache stanza to allow for this:
cache {
positive limit [ttl]
negative limit [ttl]
}
is now possible. This also add a cache_test.go in the toplevel test/
directory that exercises the caching path.
Fixes#260