Esempio n. 1
0
        public void TestSingleNodeIndex() /*throws Exception*/
        {
            TreeWizard wiz       = new TreeWizard(adaptor, tokens);
            CommonTree t         = (CommonTree)wiz.Create("ID");
            var        m         = wiz.Index(t);
            string     found     = m.ToElementString();
            string     expecting = "{10=[ID]}";

            Assert.AreEqual(expecting, found);
        }
Esempio n. 2
0
        public void TestRepeatsIndex() /*throws Exception*/
        {
            TreeWizard wiz       = new TreeWizard(adaptor, tokens);
            CommonTree t         = (CommonTree)wiz.Create("(A B (A C B) B D D)");
            var        m         = wiz.Index(t);
            string     found     = sortMapToString(m);
            string     expecting = "{5=[A, A], 6=[B, B, B], 7=[C], 8=[D, D]}";

            Assert.AreEqual(expecting, found);
        }
Esempio n. 3
0
        public void TestNoRepeatsIndex() /*throws Exception*/
        {
            TreeWizard wiz       = new TreeWizard(adaptor, tokens);
            CommonTree t         = (CommonTree)wiz.Create("(A B C D)");
            var        m         = wiz.Index(t);
            string     found     = sortMapToString(m);
            string     expecting = "{5=[A], 6=[B], 7=[C], 8=[D]}";

            assertEquals(expecting, found);
        }