public void WhenHasPragmaInTheWrongPlace() { var lines = Regex.Split(CODE_WITH_PRAGMA_WRONG_PLACE, "\r\n|\r|\n").ToImmutableList(); var actual = string.Join("\n", CodePreprocessor.checkAndRemovePragma(lines).ToArray()); actual.shouldEqual(CODE); }
public void WhenDoesntHavePragma() { var lines = Regex.Split(CODE, "\r\n|\r|\n").ToImmutableList(); var actual = string.Join("\n", CodePreprocessor.checkAndRemovePragma(lines).ToArray()); actual.shouldEqual(CODE); }
public void WhenHasPragma() { var lines = Regex.Split(CODE_WITH_PRAGMA, "\r\n|\r|\n").ToImmutableList(); var actual = string.Join("\n", CodePreprocessor.checkAndWritePragma(lines).ToArray()); actual.shouldEqual(CODE_WITH_PRAGMA); }
static void processFiles(IEnumerable <PathStr> paths, bool addPragma) { foreach (var path in paths) { CodePreprocessor.processFile(path, addPragma); } }
public void WhenHasPragma() { var lines = Regex.Split(CODE_WITH_PRAGMA, "\r\n|\r|\n").ToImmutableList(); CodePreprocessor.checkAndRemovePragma(lines).mkString("\n").shouldEqual(CODE); }