Example #1
0
        private static void TestFile(string inputName)
        {
            var isSupportingExactRoundTrip = !NotSupportingExactRoundtrip.Contains(Path.GetFileName(inputName));

            var baseDir = Path.GetFullPath(Path.Combine(BaseDirectory, RelativeBasePath));

            var inputFile = Path.Combine(baseDir, inputName);
            var inputText = File.ReadAllText(inputFile);

            var expectedOutputFile = Path.ChangeExtension(inputFile, OutputEndFileExtension);

            Assert.True(File.Exists(expectedOutputFile), $"Expecting output result file `{expectedOutputFile}` for input file `{inputName}`");
            var expectedOutputText = File.ReadAllText(expectedOutputFile, Encoding.UTF8);

            var isLiquid = inputName.Contains("liquid");

            AssertTemplate(expectedOutputText, inputText, isLiquid, false, isSupportingExactRoundTrip);
        }
Example #2
0
        private static void TestFile(string inputName)
        {
            var filename = Path.GetFileName(inputName);
            var isSupportingExactRoundtrip = !NotSupportingExactRoundtrip.Contains(filename);

            var inputText          = LoadTestFile(inputName);
            var expectedOutputName = Path.ChangeExtension(inputName, OutputEndFileExtension);
            var expectedOutputText = LoadTestFile(expectedOutputName);

            Assert.NotNull(expectedOutputText, $"Expecting output result file `{expectedOutputName}` for input file `{inputName}`");

            var lang = ScriptLang.Default;

            if (inputName.Contains("liquid"))
            {
                lang = ScriptLang.Liquid;
            }
            else if (inputName.Contains("scientific"))
            {
                lang = ScriptLang.Scientific;
            }

            AssertTemplate(expectedOutputText, inputText, lang, false, isSupportingExactRoundtrip, expectParsingErrorForRountrip: filename == "513-liquid-statement-for.variables.txt");
        }