hadley/testthat — pull request #91 by craigcitro (2013-09-09 09:27:08+00:00)
Title: Change `dir_state` to not return `NA` on missing files, and do some cleanup.

Karl Millar pointed out that the `compare_state` function ran into trouble
when `dir_state` returns `NA`; one could work around this by complicating the
comparison logic, but the larger issue is that it doesn't make sense to have
`dir_state` return `NA`. The only case where this arises is when a file is
deleted between listing a directory and computing the digest; if the file's
gone, we don't want to include it in the result of `dir_state`.

Testing this code revealed a few underlying issues due to me being a little
sloppy with interpreter state when I wrote 94d5fc6648; in particular, the
catchall in `safe_digest` was eating the exception that mentioned I hadn't
loaded the `digest` package. I've made this catch less broadly, but also
moved `digest` from `Imports` to `Depends`.