зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1293001 - Part 4: Add test for xpidl parser modifications, r=froydnj
MozReview-Commit-ID: JTtcwlVH3HN
This commit is contained in:
Родитель
ee7579d8b5
Коммит
b0e960faba
|
@ -8,6 +8,7 @@
|
|||
import mozunit
|
||||
import unittest
|
||||
import xpidl
|
||||
import header
|
||||
|
||||
|
||||
class TestParser(unittest.TestCase):
|
||||
|
@ -95,5 +96,19 @@ attribute long bar;
|
|||
self.assertEqual("bar", a.name)
|
||||
self.assertEqual("long", a.type)
|
||||
|
||||
def testOverloadedVirtual(self):
|
||||
i = self.p.parse("""[uuid(abc)] interface foo {
|
||||
attribute long bar;
|
||||
void getBar();
|
||||
};""", filename='f')
|
||||
self.assertTrue(isinstance(i, xpidl.IDL))
|
||||
class FdMock:
|
||||
def write(self, s):
|
||||
pass
|
||||
try:
|
||||
header.print_header(i, FdMock(), filename='f')
|
||||
except Exception as e:
|
||||
self.assertEqual(e.args[0], "Unexpected overloaded virtual method GetBar in interface foo")
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
Загрузка…
Ссылка в новой задаче