File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed 
core/src/test/java/com/google/errorprone/bugpatterns/flogger Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1616
1717package  com .google .errorprone .bugpatterns .flogger ;
1818
19+ import  static  org .junit .Assume .assumeTrue ;
20+ 
1921import  com .google .errorprone .CompilationTestHelper ;
22+ import  com .google .errorprone .util .RuntimeVersion ;
2023import  org .junit .Test ;
2124import  org .junit .runner .RunWith ;
2225import  org .junit .runners .JUnit4 ;
@@ -48,6 +51,24 @@ public void positive() {
4851        .doTest ();
4952  }
5053
54+   @ Test 
55+   public  void  positiveVar () {
56+     assumeTrue (RuntimeVersion .isAtLeast10 ());
57+     compilationHelper 
58+         .addSourceLines (
59+             "Test.java" ,
60+             "import com.google.common.flogger.FluentLogger;" ,
61+             "class Test {" ,
62+             "  private static final FluentLogger logger = FluentLogger.forEnclosingClass();" ,
63+             " void splitLog() {" ,
64+             "    // BUG: Diagnostic contains:" ,
65+             "    var api = logger.atInfo();" ,
66+             "    api.log(\" foo\" );" ,
67+             "  }" ,
68+             "}" )
69+         .doTest ();
70+   }
71+ 
5172  @ Test 
5273  public  void  negative () {
5374    compilationHelper 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments