Repository navigation
Conversation
Not up to standards ⛔
|
Laurettta
force-pushed
the
7.x.x/hotfix/for-loop-type-check
branch
from
November 17, 2026 23:02
099215a to
f4c1807
Compare
adamretter
requested changes
Nov 18, 2026
| } | ||
|
|
||
| @Test | ||
| public void typedForVariableWithEmptyReturn_5050() throws XMLDBException { |
Member
There was a problem hiding this comment.
Please don't name this _5050. Instead link to the GitHub issue in the Javadoc for the function.
|
|
||
| @Test | ||
| public void typedForVariableWithEmptyReturn_5050() throws XMLDBException { | ||
| final String query = "for $x as xs:string in 'X' return ()"; |
Member
There was a problem hiding this comment.
I would like to see more tests here, and the XQuery code formatted a bit more nicely please:
-
let $x := 'X' return $x
-
let $x as xs:string := 'X' return $x
-
let $result := let $x as xs:string := 'X' return $x return empty($result)
-
let $x := 'X' return ()
-
let $x as xs:string := 'X' return ()
-
let $result := let $x as xs:string := 'X' return () return empty($result)
-
for $x in 'X' return $x
-
for $x as xs:string in 'X' return $x
-
let $result := for $x as xs:string in 'X' return $x return empty($result)
-
for $x in 'X' return ()
-
for $x as xs:string in 'X' return ()
-
let $result := for $x as xs:string in 'X' return () return empty($result)
You should then also rename the test function to make it more reflective of the GitHub issue, and what it is actually testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
forvariable with a type, likefor $x as xs:string in 'X' return (), no longer gives an "Invalid cardinality" error when it returns nothing.Closes eXist-db/exist#5050