checkSchema :: IsString s => (s -> IO ()) -> Value -> FilePath -> IO ()
checkSchema step value schemaName = do
  step "Checking result against schema"
  let schema = SchemaWithURI { _swSchema = emptySchema {_schemaRef = Just $ pack schemaName}, _swURI = Just $ pack $ "test/schema/schema" </> schemaName}
  res <- liftIO $ fetchFilesystemAndValidate schema value
  case res of
    Right () -> return ()
    Left (FVRead _) -> error "Error fetching a referenced schema (either during IO or parsing)."
    Left (FVSchema _) -> error "Our 'schema' itself was invalid."
    Left f@(FVData _) -> assertFailure $ unwords ["Failed to validate", show value, ":", show f]
checkSchema :: IsString s => (s -> IO ()) -> Value -> FilePath -> IO ()
checkSchema step value schemaName = do
  step "Checking result against schema"
  let schema = SchemaWithURI { _swSchema = emptySchema {_schemaRef = Just $ pack schemaName}, _swURI = Just $ pack $ "test/schema/schema" </> schemaName}
  res <- liftIO $ fetchFilesystemAndValidate schema value
  case res of
    Right () -> return ()
    Left (FVRead _) -> error "Error fetching a referenced schema (either during IO or parsing)."
    Left (FVSchema _) -> error "Our 'schema' itself was invalid."
    Left f@(FVData _) -> assertFailure $ unwords ["Failed to validate", show value, ":", show f]
checkSchema step value schemaName = do
  step "Checking result against schema"
  let schema = SchemaWithURI { _swSchema = emptySchema {_schemaRef = Just $ pack schemaName}, _swURI = Just $ pack $ "test/schema/schema" </> schemaName}
  res <- liftIO $ fetchFilesystemAndValidate schema value
  case res of
    Right () -> return ()
    Left (FVRead _) -> error "Error fetching a referenced schema (either during IO or parsing)."
    Left (FVSchema _) -> error "Our 'schema' itself was invalid."
    Left f@(FVData _) -> assertFailure $ unwords ["Failed to validate", show value, ":", show f]