예제 #1
0
        public void Preprocess_WithoutMacros()
        {
            StdCodeEditor stdCodeEditor = new StdCodeEditor();
            string        code          =
                "+[0>0>>0>, <<, >>[ <<[ #m \"3\":\">>>\"#3[-]+ <[-<+<->>>[-] >>[-] " +
                "<<<[>>>+<<<-]] >>>[<<<+>>>-] <<[ <<<[>>>>[-]+<<<<[-" +
                "]] 3[-]] <<<] >[<+>-] <<+ 3] >>[ <<<<<- >3>-]" +
                " 0<0<0<0<0<.]p ";

            string processedCode = stdCodeEditor.Preprocess(code);

            Assert.That(processedCode, Is.EqualTo(code));
        }
예제 #2
0
        public void Preprocess_ManyMacros()
        {
            StdCodeEditor stdCodeEditor = new StdCodeEditor();
            string        code          =
                "+[0>0>>0>, <<, >>[ <<[ #m\"3\":\">>>\"#3[-]+ <[-<+<->>>[-] >>[-] " +
                "<<<[>>>+<<<-]] >>>[<<<#m\"plus\":\"+\"#plus>>>-] <<[ <<<[>>>>[-]plus<<<<[-" +
                "]] 3[-]] <<<] >[<+>-] <<plus 3] >>[ <<3plus <<<- >3>-]" +
                " 0<0<0<0<0<.]p ";

            string processedCode = stdCodeEditor.Preprocess(code);

            Assert.That(processedCode, Is.EqualTo("+[0>0>>0>, <<, >>[ <<[ >>>[-]+ <[-<+<->>>[-] >>[-] " +
                                                  "<<<[>>>+<<<-]] >>>[<<<+>>>-] <<[ <<<[>>>>[-]+<<<<[-" +
                                                  "]] >>>[-]] <<<] >[<+>-] <<+ >>>] >>[ <<>>>+ <<<- >>>>>-]" +
                                                  " 0<0<0<0<0<.]p "));
        }