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

Method testLambda

cpplint_unittest.py:3107–3129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3105 self.TestLint("void foo(int param [[maybe_unused]]);", "")
3106
3107 def testLambda(self):
3108 self.TestLint("auto x = []() {};", "")
3109 self.TestLint("return []() {};", "")
3110 self.TestMultiLineLint("auto x = []() {\n};\n", "")
3111 self.TestLint(
3112 "int operator[](int x) {};", "You don't need a ; after a } [readability/braces] [4]"
3113 )
3114
3115 self.TestMultiLineLint("auto x = [&a,\nb]() {};", "")
3116 self.TestMultiLineLint("auto x = [&a,\nb]\n() {};", "")
3117 self.TestMultiLineLint(
3118 "auto x = [&a,\n"
3119 " b](\n"
3120 " int a,\n"
3121 " int b) {\n"
3122 " return a +\n"
3123 " b;\n"
3124 "};\n",
3125 "",
3126 )
3127
3128 # Avoid false positives with operator[]
3129 self.TestLint("table_to_children[&*table].push_back(dependent);", "")
3130
3131 def testBraceInitializerList(self):
3132 self.TestLint("MyStruct p = {1, 2};", "")

Callers

nothing calls this directly

Calls 2

TestLintMethod · 0.80
TestMultiLineLintMethod · 0.80

Tested by

no test coverage detected