Repository navigation
[7.x.x] Typed for variable no longer failson an empty return #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop-7.x.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2452,6 +2452,18 @@ public void wrongInvalidTypeError_1787285() throws XMLDBException { | |
| } | ||
| } | ||
|
|
||
| @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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to see more tests added. Just two JUnit Test functions please, one for
Please also rename the test functions you create to make it more reflective of the GitHub issue, and what it is actually testing.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some more (: for - returning $x :)
for $x as empty-sequence() allowing empty in ()
return
$x
,
for $x as xs:integer in ()
return
$x
,
for $x as xs:integer? in ()
return
$x
,
for $x as xs:integer+ in ()
return
$x
,
for $x as xs:integer* in ()
return
$x
,
for $x as empty-sequence() allowing empty in (1, 2, 3)
return
$x
,
for $x as xs:integer in (1,2,3)
return
$x
,
for $x as xs:integer? in (1,2,3)
return
$x
,
for $x as xs:integer+ in (1,2,3)
return
$x
,
for $x as xs:integer* in (1,2,3)
return
$x
,
(: for - returning empty-sequence() :)
for $x as empty-sequence() allowing empty in ()
return
()
,
for $x as xs:integer in ()
return
()
,
for $x as xs:integer? in ()
return
()
,
for $x as xs:integer+ in ()
return
()
,
for $x as xs:integer* in ()
return
()
,
for $x as empty-sequence() allowing empty in (1,2,3)
return
()
,
for $x as xs:integer in (1,2,3)
return
()
,
for $x as xs:integer? in (1,2,3)
return
()
,
for $x as xs:integer+ in (1,2,3)
return
()
,
for $x as xs:integer* in (1,2,3)
return
()
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some more (: let - returning $x :)
let $x as empty-sequence() := ()
return
$x
,
let $x as xs:integer := ()
return
$x
,
let $x as xs:integer? := ()
return
$x
,
let $x as xs:integer+ := ()
return
$x
,
let $x as xs:integer* := ()
return
$x
,
let $x as xs:integer := (1,2,3)
return
$x
,
let $x as xs:integer? := (1,2,3)
return
$x
,
let $x as xs:integer+ := (1,2,3)
return
$x
,
let $x as xs:integer* := (1,2,3)
return
$x
,
(: let - returning empty-sequence() :)
let $x as empty-sequence() := ()
return
()
,
let $x as xs:integer := ()
return
()
,
let $x as xs:integer? := ()
return
()
,
let $x as xs:integer+ := ()
return
()
,
let $x as xs:integer* := ()
return
()
,
let $x as xs:integer := (1,2,3)
return
()
,
let $x as xs:integer? := (1,2,3)
return
()
,
let $x as xs:integer+ := (1,2,3)
return
()
,
let $x as xs:integer* := (1,2,3)
return
()
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adamretter while adding your queries as tests I found that |
||
| try (final Collection testCollection = getTestCollection()) { | ||
| final XPathQueryService service = testCollection.getService(XPathQueryService.class); | ||
| try (final EXistResourceSet result = (EXistResourceSet) service.query(query)) { | ||
| assertEquals(0, result.getSize()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Regression | ||
| * | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't name this
_5050. Instead link to the GitHub issue in the Javadoc for the function.