From 8a98ccd361822ae0a029397f7fef6be6e402c702 Mon Sep 17 00:00:00 2001 From: Sascha Weinreuter Date: Fri, 9 Dec 2011 15:51:08 +0100 Subject: [PATCH] another test --- .../intellij/lang/xpath/xslt/XsltResolveTest.java | 13 +++++++++---- .../testData/xslt/resolve/resolveFunction.xsl | 9 +++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 plugins/xpath/xpath-lang/testData/xslt/resolve/resolveFunction.xsl diff --git a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltResolveTest.java b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltResolveTest.java index 10b38625bf02..e0234af216c8 100644 --- a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltResolveTest.java +++ b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltResolveTest.java @@ -49,6 +49,10 @@ public class XsltResolveTest extends TestBase { } public void testResolveIncludedFunction() throws Throwable { + doFunctionResolveTest("included-2.xsl"); + } + + public void testResolveFunction() throws Throwable { doFunctionResolveTest(); } @@ -101,15 +105,16 @@ public class XsltResolveTest extends TestBase { return var; } - private XsltFunction doFunctionResolveTest() throws Throwable { - final PsiReference reference = findInjectedReferenceAtCaret("included-2.xsl"); + private XsltFunction doFunctionResolveTest(String... files) throws Throwable { + final PsiReference reference = findInjectedReferenceAtCaret(files); final PsiElement element = reference.resolve(); assertTrue(element instanceof XsltFunction); final XsltFunction func = (XsltFunction)element; - assertEquals(func.getName(), ((XPathFunctionCall)reference.getElement()).getFunctionName()); - + final XPathFunctionCall call = (XPathFunctionCall)reference.getElement(); + assertEquals(func.getName(), call.getFunctionName()); + assertEquals(func.getParameters().length, call.getArgumentList().length); return func; } diff --git a/plugins/xpath/xpath-lang/testData/xslt/resolve/resolveFunction.xsl b/plugins/xpath/xpath-lang/testData/xslt/resolve/resolveFunction.xsl new file mode 100644 index 000000000000..61729b08ae76 --- /dev/null +++ b/plugins/xpath/xpath-lang/testData/xslt/resolve/resolveFunction.xsl @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file