mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
another test
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user