コード例 #1
0
ファイル: testtree.py プロジェクト: 10114395/android-5.0.0_r5
    def testReset(self):
        adaptor = CommonTreeAdaptor()
        wiz = TreeWizard(adaptor, self.tokens)
        t = wiz.create("(A (B (C D E) F) G)")
        it = TreeIterator(t)
        expecting = "A DOWN B DOWN C DOWN D E UP F UP G UP EOF"
        found = self.toString(it)
        self.assertEquals(expecting, found)

        it.reset()
        expecting = "A DOWN B DOWN C DOWN D E UP F UP G UP EOF"
        found = self.toString(it)
        self.assertEquals(expecting, found)
コード例 #2
0
    def testReset(self):
        adaptor = CommonTreeAdaptor()
        wiz = TreeWizard(adaptor, self.tokens)
        t = wiz.create("(A (B (C D E) F) G)")
        it = TreeIterator(t)
        expecting = "A DOWN B DOWN C DOWN D E UP F UP G UP EOF"
        found = self.toString(it)
        self.assertEqual(expecting, found)

        it.reset()
        expecting = "A DOWN B DOWN C DOWN D E UP F UP G UP EOF"
        found = self.toString(it)
        self.assertEqual(expecting, found)
コード例 #3
0
 def testVerticalList(self):
     adaptor = CommonTreeAdaptor()
     wiz = TreeWizard(adaptor, self.tokens)
     t = wiz.create("(A (B C))")
     it = TreeIterator(t)
     expecting = "A DOWN B DOWN C UP UP EOF"
     found = self.toString(it)
     self.assertEqual(expecting, found)
コード例 #4
0
 def testFlatAB(self):
     adaptor = CommonTreeAdaptor()
     wiz = TreeWizard(adaptor, self.tokens)
     t = wiz.create("(nil A B)")
     it = TreeIterator(t)
     expecting = "nil DOWN A B UP EOF"
     found = self.toString(it)
     self.assertEqual(expecting, found)
コード例 #5
0
 def testNode(self):
     adaptor = CommonTreeAdaptor()
     wiz = TreeWizard(adaptor, self.tokens)
     t = wiz.create("A")
     it = TreeIterator(t)
     expecting = "A EOF"
     found = self.toString(it)
     self.assertEqual(expecting, found)
コード例 #6
0
 def testABC(self):
     adaptor = CommonTreeAdaptor()
     wiz = TreeWizard(adaptor, self.tokens)
     t = wiz.create("(A B C)")
     it = TreeIterator(t)
     expecting = "A DOWN B C UP EOF"
     found = self.toString(it)
     self.assertEquals(expecting, found)