def testRepr(self):
        comment = statetracker.DocComment(None)
        comment.AddFlag(self._MakeDocFlagFake('param', 'foo'))
        comment.AddFlag(self._MakeDocFlagFake('param', 'bar'))

        self.assertEquals(
            '<DocComment: [\'foo\', \'bar\'], [@param foo, @param bar]>',
            repr(comment))
    def testSuppressionOnly(self):
        comment = statetracker.DocComment(None)

        self.assertFalse(comment.SuppressionOnly())
        comment.AddFlag(self._MakeDocFlagFake('suppress'))
        self.assertTrue(comment.SuppressionOnly())
        comment.AddFlag(self._MakeDocFlagFake('foo'))
        self.assertFalse(comment.SuppressionOnly())
    def testInvalidate(self):
        comment = statetracker.DocComment(None)

        self.assertFalse(comment.invalidated)
        self.assertFalse(comment.IsInvalidated())

        comment.Invalidate()

        self.assertTrue(comment.invalidated)
        self.assertTrue(comment.IsInvalidated())
    def testDocFlags(self):
        comment = statetracker.DocComment(None)

        a = self._MakeDocFlagFake('param', 'foo')
        comment.AddFlag(a)

        b = self._MakeDocFlagFake('param', '')
        comment.AddFlag(b)

        c = self._MakeDocFlagFake('param', 'bar')
        comment.AddFlag(c)

        self.assertEquals(['foo', 'bar'], comment.ordered_params)

        self.assertEquals([a, b, c], comment.GetDocFlags())