Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 static void processFiles(IEnumerable <PathStr> paths, bool addPragma)
 {
     foreach (var path in paths)
     {
         CodePreprocessor.processFile(path, addPragma);
     }
 }
Exemplo n.º 5
0
        public void WhenHasPragma()
        {
            var lines = Regex.Split(CODE_WITH_PRAGMA, "\r\n|\r|\n").ToImmutableList();

            CodePreprocessor.checkAndRemovePragma(lines).mkString("\n").shouldEqual(CODE);
        }