MCPcopy Index your code
hub / github.com/cpplint/cpplint / testNamespace

Method testNamespace

cpplint_unittest.py:6781–6801  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6779 assert self.nesting_state.stack == []
6780
6781 def testNamespace(self):
6782 self.UpdateWithLines(["namespace {"])
6783 assert len(self.nesting_state.stack) == 1
6784 assert isinstance(self.nesting_state.stack[0], cpplint._NamespaceInfo)
6785 assert self.nesting_state.stack[0].seen_open_brace
6786 assert self.nesting_state.stack[0].name == ""
6787
6788 self.UpdateWithLines(["namespace outer { namespace inner"])
6789 assert len(self.nesting_state.stack) == 3
6790 assert self.nesting_state.stack[0].seen_open_brace
6791 assert self.nesting_state.stack[1].seen_open_brace
6792 assert not self.nesting_state.stack[2].seen_open_brace
6793 assert self.nesting_state.stack[0].name == ""
6794 assert self.nesting_state.stack[1].name == "outer"
6795 assert self.nesting_state.stack[2].name == "inner"
6796
6797 self.UpdateWithLines(["{"])
6798 assert self.nesting_state.stack[2].seen_open_brace
6799
6800 self.UpdateWithLines(["}", "}}"])
6801 assert len(self.nesting_state.stack) == 0
6802
6803 def testDecoratedClass(self):
6804 self.UpdateWithLines(["class Decorated_123 API A {"])

Callers

nothing calls this directly

Calls 1

UpdateWithLinesMethod · 0.95

Tested by

no test coverage detected