From e7e7a140cd60c0babb6c5e90791f9751b62ba532 Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Mon, 27 Oct 2025 12:41:02 +0100 Subject: [PATCH] fix: add cardinality to return type fixes #133 --- src/main/xar-resources/modules/app.xqm | 2 +- src/test/cypress/integration/fundoc_spec.cy.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/xar-resources/modules/app.xqm b/src/main/xar-resources/modules/app.xqm index 0e754e1..c747824 100644 --- a/src/main/xar-resources/modules/app.xqm +++ b/src/main/xar-resources/modules/app.xqm @@ -327,7 +327,7 @@ function app:print-function-header($function as element(xqdoc:function)) as elem {$para/xqdoc:type/string()}, $para/xqdoc:type/@occurrence/string() || $comma ) - }) as {$function/xqdoc:return/xqdoc:type/string()} + }) as {$function/xqdoc:return/xqdoc:type/string()}{$function/xqdoc:return/xqdoc:type/@occurrence/string()} }; diff --git a/src/test/cypress/integration/fundoc_spec.cy.js b/src/test/cypress/integration/fundoc_spec.cy.js index 178c014..6e55eca 100644 --- a/src/test/cypress/integration/fundoc_spec.cy.js +++ b/src/test/cypress/integration/fundoc_spec.cy.js @@ -61,6 +61,15 @@ context('Function Documentation', () => { }) }) + describe('Searching for a specific function, map:keys', () => { + it('should show the correct function signature', () => { + cy.visit('?q=map%3Akeys').get('.signature') + .should('have.text', 'map:keys($map as map(*)) as xs:anyAtomicType*') + }) + }) + + + describe('browse', () => { it('should find local modules', () => { cy.get('#browse')