Пример #1
0
        public void PHPForLoopAndEchoTest()
        {
            RichTextBox rtb = new RichTextBox();

            // input
            rtb.Rtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang" + Properties.Settings.Default.rtflangused + @"{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red255\green223\blue35;}
\viewkind4\uc1\pard\cf1\fs24 <?php\par
for ($i = 0; $i < 10; $i++) \{\par
echo 'test';\par
\}\par
\par
?>\par
}";

            string exceptedrtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red0\green0\blue0;\red65\green216\blue123;\red18\green150\blue18;\red64\green64\blue64;}
\viewkind4\uc1\pard\cf1\fs24 <?php\par
\cf2 for\cf1  (\cf3 $i\cf1  = 0; \cf3 $i\cf1  < 10; \cf3 $i\cf1 ++) \{\par
\cf2 echo\cf1 \cf4 'test'\cf1 ;\par
\}\par
\par
?>\par
}";
            int    skinnr      = 1;

            Settings.HighlightPHP = true;
            Notes notes = new Notes(false);

            SyntaxHighlight.InitHighlighter();
            SyntaxHighlight.CheckSyntaxFull(rtb, skinnr, notes);
            Assert.AreEqual(exceptedrtf, rtb.Rtf, "PHPForLoopAndEchoTest failed.");
        }
Пример #2
0
 public static void SyntaxHighlighTestInitialize(TestContext testContext)
 {
     SyntaxHighlight.InitHighlighter();
 }