Package com.python.pydev.analysis.additionalinfo

Examples of com.python.pydev.analysis.additionalinfo.ClassInfo


    public void testPatternMatch() throws Exception {
        SearchPattern patternMatcher = new SearchPattern();
        patternMatcher.setPattern("aa");

        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aa", null, null)));

        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", null, null)));

        assertFalse(MatchHelper.matchItem(patternMatcher, new ClassInfo("baaa", null, null)));

        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "coi.foo", null)));

        patternMatcher.setPattern("xx.aa");
        assertFalse(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "invalid.foo", null)));

        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "xx.foo", null)));

        patternMatcher.setPattern("xx.foo.aa");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "xx.foo.bar", null)));

        patternMatcher.setPattern("xx.foo.bar.aa");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "xx.foo.bar", null)));

        patternMatcher.setPattern("xx.foo.bar.aa.aa");
        assertFalse(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "xx.foo.bar", null)));

        patternMatcher.setPattern("xx.foo.ba.aa");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "xx.foo.bar", null)));

        patternMatcher.setPattern("xx.fo*o.ba.aa");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("aaa", "xx.foo.bar", null)));

        patternMatcher.setPattern("coi*.intersection");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("Intersection", "coilib50.basic.native", null)));

        patternMatcher.setPattern("coilib50.intersection");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("Intersection", "coilib50.basic.native", null)));

        patternMatcher.setPattern("coilib50.");
        assertTrue(MatchHelper.matchItem(patternMatcher, new ClassInfo("Intersection", "coilib50.basic.native", null)));
    }
View Full Code Here

TOP

Related Classes of com.python.pydev.analysis.additionalinfo.ClassInfo

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.