Bug 1293001 - Part 4: Add test for xpidl parser modifications, r=froydnj

MozReview-Commit-ID: JTtcwlVH3HN
This commit is contained in:
Michael Layzell 2016-08-11 13:54:17 -04:00
Родитель ee7579d8b5
Коммит b0e960faba
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -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()