Exemple #1
0
        public static void CheckSeparators()
        {
            string testName = "Separators1";
            string testLine = " .     , ; ():.";
            string result   = ScannerUtils.ScanLine(testLine);

            ScannerUtils.CheckWithResultFile(result, testName);

            testName = "Separators2";
            string[] testLines = new string[] {
                "",
                "   ",
                ",,,",
                ";;;",
                "...",
                ":::",
                "(((",
                ")))"
            };
            result = ScannerUtils.ScanLines(testLines);
            ScannerUtils.CheckWithResultFile(result, testName);

            testName = "Separators3";
            testLine = "(.025 * .44) + 1.18.";
            result   = ScannerUtils.ScanLine(testLine);
            ScannerUtils.CheckWithResultFile(result, testName);
        }
Exemple #2
0
        public static void CheckComments()
        {
            string     testName       = "Comments1";
            TokensLine testTokensLine = new TestTokensLine('*', "This is a comment line ! ***");
            string     result         = ScannerUtils.ScanTextLine(testTokensLine);

            ScannerUtils.CheckWithResultFile(result, testName);

            testName = "Comments2";
            string testLine = "01 TOTO *> Comment until end of line 1.";

            result = ScannerUtils.ScanLine(testLine);
            ScannerUtils.CheckWithResultFile(result, testName);

            testName = "CommentsDebugging";
            string[] testLines = new string[] {
                "D CONFIGURATION SECTION.",
                "SOURCE-COMPUTER. IBM-392 WITH DEBUGGING MODE.",
                "D DISPLAY TOTO"
            };
            result = ScannerUtils.ScanLines(testLines);
            ScannerUtils.CheckWithResultFile(result, testName);
        }