================
@@ -2305,7 +2335,45 @@ TEST(BlockEndHints, PointerToMemberFunction) {
       $ptrmem[[}]]
     } // suppress
   )cpp",
-                      ExpectedHint{" // if", "ptrmem"});
+                      ExpectedHint{" // if ()", "ptrmem"});
+}
+
+TEST(BlockEndHints, MinLineLimit) {
+  assertBlockEndHintsWithOpts(
+      R"cpp(
+    namespace ns {
+      int Var;
+      int func1();
+      int func2(int, int);
+      struct S {
+        int Field;
+        int method1() const;
+        int method2(int, int) const;
+      $struct[[}]];
+    $namespace[[}]]
+    void foo() {
+      int int_a {};
+      while (ns::Var) {
+      $var[[}]]
+
+      while (ns::func1()) {
+      $func1[[}]]
+
+      while (ns::func2(int_a, int_a)) {
+      $func2[[}]]
+
+      while (ns::S{}.Field) {
+      $field[[}]]
+
+      while (ns::S{}.method1()) {
+      $method1[[}]]
+      
+      while (ns::S{}.method2(int_a, int_a)) {
+      $method2[[}]]
+    $foo[[}]]
+  )cpp",
+      InlayHintOptions{10}, ExpectedHint{" // namespace ns", "namespace"},
----------------
HighCommander4 wrote:

I'd rather we be a bit more explicit:

```c++
InlayhintOptions Opts;
Opts.HintMinLineLimit = 10;
...
assertBlockEndHintsWithOpts(..., Opts, ...);
```

as there may be more options in the future and it's not obvious which is first.

https://github.com/llvm/llvm-project/pull/136106
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to