/*
 * Copyright 2000-2015 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jetbrains.python.inspections;

import com.jetbrains.python.fixtures.PyTestCase;
import com.jetbrains.python.psi.LanguageLevel;

/**
 * @author vlan
 */
public class PyStringFormatInspectionTest extends PyTestCase {
  public static final String TEST_DIRECTORY = "inspections/PyStringFormatInspection/";

  public void testBasic() {
    doTest();
  }

  // PY-2836
  public void testDictionaryArgument() {
    doTest();
  }

  // PY-4647
  public void testTupleMultiplication() {
    doTest();
  }

  // PY-6756
  public void testSlice() {
    doTest();
  }
  
  // PY-18954
  public void testOneElementDict() {
    doTest();
  }
  
  // PY-18725
  public void testDictWithReferenceKeys() {
    doTest();
  }
  
  public void testTooFewArgumentsNewStyleFormat() {
    doTest();
  }
  
  public void testTooManyArgumentsNewStyleFormat() {
    doTest();
  }
  
  public void testUnusedMappingNewStyleFormat() {
    doTest();
  }
  
  public void testIncompatibleTypesNewStyleFormat() {
    doTest();
  }
  
  public void testNewStyleMappingKeyWithSubscriptionListArg() {
    doTest();
  }
  
  public void testNewStyleMappingKeyWithSubscriptionFuncArgs() {
    doTest();
  }
  
  public void testNewStyleMappingKeyWithSubscriptionRefArgs() {
    doTest();
  }
  
  public void testNewStyleMappingKeyWithSubscriptionDictArg() {
    doTest();
  }

  public void testNewStyleMappingKeyWithSubscriptionRefDictArg() {
    doTest();
  }
  
  public void testNewStyleMappingKeyWithSubscriptionFuncDictArg() {
    doTest();
  }
  
  public void testNewStyleMappingKeyWithSubscriptionParenArg() {
    doTest();
  }
  
  public void testNewStyleStringWithPercentSymbol() {
    doTest();
  }
  
  public void testNewStylePackedAndNonPackedArgs() {
    doTest();
  }
  
  public void testNewStyleEmptyDictArg() {
    doTest();
  }
  
  public void testNewStyleDictLiteralExprInsideDictCall() {
    doTest();
  }
  
  public void testNewStylePositionalSubstitutionWithDictArg() {
    doTest();
  }
  
  public void testNewStylePackedReference() {
    doTest();
  }
  
  public void testNewStylePackedFunctionCall() {
    doTest();
  }
  
  public void testNewStyleStringRegularExpression() {
    doTest();
  }
  
  public void testNewStyleStringMapArg() {
    doTest();
  }
  
  public void testNewStyleDictLiteralWithReferenceKeys() {
    doTest();
  }
  
  public void testNewStyleDictLiteralWithNumericKeys() {
    doTest();
  }
  
  public void testNewStyleCallExpressionArgument() {
    doTest();
  }
  
  public void testPercentStringWithFormatStringReplacementSymbols() {
    doTest();
  }
  
  public void testPercentStringPositionalWithEmptyDictArg() {
    doTest();
  }
  
  public void testPercentStringWithDictElement() {
    doTest();
  }
  
  public void testPercentStringWithDictCall() {
    doTest();
  }
  
  public void testPercentStringWithDictArgument() {
    doTest();
  }
  
  public void testPercentStringPositionalListArgument() {
    doTest();
  }
  
  public void testPercentStringPositionalDictArgument() {
    doTest();
  }
  
  public void testPercentStringKeywordSetArgument() {
    doTest();
  }
  
  public void testPercentStringKeywordListArgument() {
    doTest();
  }
  
  public void testPercentStringCallUnionArgument() {
    doTest();
  } 
  
  public void testPercentStringCallArgument() {
    doTest();
  }
  
  // PY-8325
  public void testTooFewMappingKeys() {
    doTest();
  }
  
  // PY-20599
  public void testPy3kAsciiFormatSpecifier() {
    runWithLanguageLevel(LanguageLevel.PYTHON35, new Runnable() {
      @Override
      public void run() {
        doTest();        
      }
    });
  }

  //PY-21166
  public void testUnsupportedFormatSpecifierNewStyleFormatting() {
    doTest();
  }

  private void doTest() {
    myFixture.configureByFile(TEST_DIRECTORY + getTestName(false) + ".py");
    myFixture.enableInspections(PyStringFormatInspection.class);
    myFixture.checkHighlighting(true, false, true);
  }
}

@@ -4127,106 +4127,22 @@
 35, 
-new Runnable() %7B%0A      @Override%0A      public void run() %7B%0A        doTest();        %0A      %7D%0A    %7D
+() -%3E doTest()
 );%0A 

Minor Convert runnable to lambda