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

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