another test

This commit is contained in:
Sascha Weinreuter
2011-12-09 15:51:08 +01:00
parent 5675c4202d
commit 8a98ccd361
2 changed files with 18 additions and 4 deletions
@@ -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;
}
@@ -0,0 +1,9 @@
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:nsx="nsx" xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xsl:function name="nsx:func1" as="xs:boolean+">
<xsl:sequence select="(false(), true())"/>
</xsl:function>
<xsl:template match="/">
<xsl:variable name="test" select="nsx:func1<caret>()" />
</xsl:template>
</xsl:stylesheet>