Package org.python.pydev.editor.correctionassist.heuristics

Examples of org.python.pydev.editor.correctionassist.heuristics.PercentToBraceConverter$PercentConversion


        int i = 0;
        for (String input : inputs) {
            String expectedResult = expectedResults[i];

            PercentToBraceConverter fixture = new PercentToBraceConverter(input);
            fixture.setSkipFormatCallReplacement(true);
            String result = fixture.convert();

            assertEquals(expectedResult, result);
            i++;
        }
    }
View Full Code Here


        for (int i = 0; i < inputs.length; i++) {

            String input = inputs[i];
            String inputOther = inputsOther[i];

            PercentToBraceConverter fixture = new PercentToBraceConverter(input);
            PercentToBraceConverter fixtureOther = new PercentToBraceConverter(inputOther);

            boolean expectedResult = expectedResults[i];

            assertEquals(expectedResult, fixture.equals(fixtureOther));
View Full Code Here

     * Run the boolean equals(Object) method test for converters
     * constructed from same inputs but with varying object state.
     */
    public void testEqualsWithVaryingState() {
       
        PercentToBraceConverter fixture = new PercentToBraceConverter("");
        PercentToBraceConverter other = new PercentToBraceConverter("");
       
        fixture.setSkipFormatCallReplacement(true);
        other.setSkipFormatCallReplacement(false); // false is the default, but this makes it explicit

        boolean result = fixture.equals(other);
        assertEquals(false, result);
       
        // now the inverse test
View Full Code Here

    /**
     * Run the boolean equals(Object) method test with "bogus" input.
     */
    public void testEqualsBogus() {
        PercentToBraceConverter fixture = new PercentToBraceConverter("");
       
        boolean result = fixture.equals(null);
        assertEquals(false, result);
       
        result = fixture.equals("");
        assertEquals(false, result);
       
        result = fixture.equals(Integer.valueOf(3));
        assertEquals(false, result);
    }
View Full Code Here

        int i = 0;
        for (String input : inputs) {
            int expectedResult = expectedResults[i];

            PercentToBraceConverter fixture = new PercentToBraceConverter(input);
            int result = fixture.getLength();

            assertEquals(0, result);

            fixture.convert();
            result = fixture.getLength();

            assertEquals(expectedResult, result);
            i++;
        }
View Full Code Here

    /**
     * Run the int hashCode() method test.
     */
    public void testHashCode() {
       
        PercentToBraceConverter fixture = new PercentToBraceConverter("");
        fixture.setSkipFormatCallReplacement(false);

        int result = fixture.hashCode();
        assertEquals(1, result);
       
        fixture.setSkipFormatCallReplacement(true);
        result = fixture.hashCode();
        assertEquals(2, result);
       
        String stringToConvert1 = "this is just a test";
        fixture = new PercentToBraceConverter(stringToConvert1);
        result = fixture.hashCode();
        assertEquals(1 + stringToConvert1.hashCode(), result);
    }
View Full Code Here

    /**
     * Run the boolean isSkippingFormatCallReplacement() method test.
     */
    public void testIsSkippingFormatCallReplacement() {
       
        PercentToBraceConverter fixture = new PercentToBraceConverter("this is string");
        fixture.setSkipFormatCallReplacement(true);

        boolean result = fixture.isSkippingFormatCallReplacement();

        // add additional test code here
        assertEquals(true, result);

        fixture.setSkipFormatCallReplacement(false);
        result = fixture.isSkippingFormatCallReplacement();

        assertEquals(false, result);
    }
View Full Code Here

    /**
     * Run the String toString() method test.
     */
    public void testToString() {
       
        PercentToBraceConverter fixture = new PercentToBraceConverter("");
        fixture.setSkipFormatCallReplacement(true);

        String result = fixture.toString();

        assertEquals("<PercentToBraceConverter@0x2 | source= match= argIndex=0 head= tail=>", result);
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.correctionassist.heuristics.PercentToBraceConverter$PercentConversion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.