From 3b7033d046fcec7e72bc779429c1fcce21fee543 Mon Sep 17 00:00:00 2001 From: Cameron Ross Date: Fri, 23 Mar 2018 21:14:35 -0300 Subject: [PATCH] allow dyaml.test.reader.testStreamError to be @safe --- source/dyaml/test/reader.d | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/dyaml/test/reader.d b/source/dyaml/test/reader.d index 597aff8..9bf5dde 100644 --- a/source/dyaml/test/reader.d +++ b/source/dyaml/test/reader.d @@ -38,10 +38,16 @@ void runReader(const bool verbose, ubyte[] fileData) @safe /// /// Params: verbose = Print verbose output? /// errorFilename = File name to read from. -void testStreamError(bool verbose, string errorFilename) @trusted +void testStreamError(bool verbose, string errorFilename) @safe +{ + runReader(verbose, readData(errorFilename)); +} + +// TODO: remove when a @safe ubyte[] file read can be done. +ubyte[] readData(string filename) @trusted { import std.file; - runReader(verbose, cast(ubyte[])std.file.read(errorFilename)); + return cast(ubyte[])std.file.read(filename); } @safe unittest