getFailureFile method

File getFailureFile (String failure, Uri golden Uri basedir)

Returns the appropriate file for a given diff from a ComparisonResult.

Implementation

File getFailureFile(String failure, Uri golden, Uri basedir) {
  final String fileName = golden.pathSegments[0];
  final String testName = fileName.split(path.extension(fileName))[0]
    + '_'
    + failure
    + '.png';
  return File(path.join(
    path.fromUri(basedir),
    path.fromUri(Uri.parse('failures/$testName')),
  ));
}