import std.stdio, std.string; auto text = `Ddoc This file is a $(unknown standalone) Ddoc file. It can contain any kind of $(MAC macros), defined in the $(MAC 'Macros:' section). Macros: MAC=$0 _= `; auto expected1 = `This file is a Ddoc file. It can contain any kind of macros, defined in the 'Macros:' section.`; auto expected2 = `This file is a $(unknown standalone) Ddoc file. It can contain any kind of macros, defined in the 'Macros:' section.`; auto lex = Lexer(text, true); // Whitespace and newline before / after not taken into account. auto res = parseDDString(text, null).strip; assert(res == expected1, res); res = parseDDString(text, null, false).strip; assert(res == expected2, res);