From c5b7987e68240efb81eebc2b56e5964ea6ca563f Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Thu, 31 Jul 2014 03:12:02 +0200 Subject: [PATCH] Using non-Stream Loader ctor in Representer test. --- test/src/representer.d | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/src/representer.d b/test/src/representer.d index 4281b0c..f19d37d 100644 --- a/test/src/representer.d +++ b/test/src/representer.d @@ -15,14 +15,12 @@ import dyaml.testcommon; import dyaml.testconstructor; -/** - * Representer unittest. - * - * Params: verbose = Print verbose output? - * codeFilename = File name to determine test case from. - * Nothing is read from this file, it only exists - * to specify that we need a matching unittest. - */ +/// Representer unittest. +/// +/// Params: verbose = Print verbose output? +/// codeFilename = File name to determine test case from. +/// Nothing is read from this file, it only exists +/// to specify that we need a matching unittest. void testRepresenterTypes(bool verbose, string codeFilename) { string baseName = codeFilename.baseName.stripExtension; @@ -57,12 +55,11 @@ void testRepresenterTypes(bool verbose, string codeFilename) dumper.dump(expectedNodes); output = cast(string)emitStream.data; - auto loadStream = new MemoryStream(emitStream.data); auto constructor = new Constructor; constructor.addConstructorMapping("!tag1", &constructClass); constructor.addConstructorScalar("!tag2", &constructStruct); - auto loader = Loader(loadStream); + auto loader = Loader(emitStream.data.dup); loader.name = "TEST"; loader.constructor = constructor; readNodes = loader.loadAll();