w3c / qt3tests

Tests for XPath and XQuery
27 stars 17 forks source link

fn-round K-RoundFunc-2 #39

Closed adamretter closed 2 years ago

adamretter commented 2 years ago

I (CC @alanpaxton) just want to check my understand of K-RoundFunc-2 from the fn-round test-set: https://github.com/evolvedbinary/qt3tests/blob/master/fn/round.xml#L397

I see that it is different from K-RoundFunc-2a in terms of its dependencies:

  1. K-RoundFunc-2 depends on XQuery 1.0
  2. K-RoundFunc-2a depends on XQuery 3.0+

I have tested the following query against recent Saxon, BaseX, and eXist-db, and all of them return 1 instead of the error XPST0017:

xquery version "1.0";
round(1, 2)

They each return the same result (i.e. 1) as running:

xquery version "3.0";
round(1, 2)

Does this mean that each of those 3 processors is not correctly implementing the version declaration, and are failing this test?

Comparing the version declaration behaviour between XQuery 1.0 and XQuery 3.0 is not straight-forward:

  1. https://www.w3.org/TR/2010/REC-xquery-20101214/#id-version-declaration
  2. https://www.w3.org/TR/xquery-30/#id-version-declaration
ChristianGruen commented 2 years ago

Hi @adamretter, some time ago, we have stopped explicit support for older versions of XQuery. All queries will be interpreted by our XQuery 3.1 processor as long as the supplied version number is registered (currently: 1.0, 1.1, 3.0, 3.1).

adamretter commented 2 years ago

@ChristianGruen In that case then, do you think the test should be modified so that it also passes if a processor supports XQuery 1.0 but runs it using a 3.1 processor?

ChristianGruen commented 2 years ago

I believe it’s correct to raise XPST0017. With BaseX, we don’t run test cases anymore that are restricted to older versions.

I just tested Zorba: The last official release is pretty old now, but it supported both 1.0 and 3.0, and it returns either XPST0017 or 1, depending on the supplied version.

michaelhkay commented 2 years ago

If a test has a metadata dependency spec="XQ10", then that test should only be run if you have a processor that claims conformance with the XQuery 1.0 specification.

Saxonica no longer offers such a processor, so we don't run the test.

Saxonica's processors don't use the xquery version declaration to decide what kind of processor to run (though it would be legal to do so). If the query prolog says version="1.0", then we will do whatever the XQuery 3.1 specification says that a processor should do if presented with such input. And the XQuery 3.1 specification does NOT say that this query should be rejected; it says that it should return 1.

Michael Kay Saxonica

On 14 Jun 2022, at 18:15, Adam Retter @.***> wrote:

I just want to check my understand of K-RoundFunc-2 from the fn-round test-set: https://github.com/evolvedbinary/qt3tests/blob/master/fn/round.xml#L397 https://github.com/evolvedbinary/qt3tests/blob/master/fn/round.xml#L397 I see that it is different from K-RoundFunc-2a in terms of its dependencies:

K-RoundFunc-2 depends on XQuery 1.0 K-RoundFunc-2 depends on XQuery 3.0+ I have tested the following query against recent Saxon, BaseX, and eXist-db, and all of them return 1 instead of the error XPST0017:

xquery version "1.0"; round(1, 2) They each return the same result (i.e. 1) as running:

xquery version "3.0"; round(1, 2) Does this mean that each of those 3 processors is not correctly implementing the version declaration, and are failing this test?

Comparing the version declaration behaviour between XQuery 1.0 and XQuery 3.0 is not straight-forward:

https://www.w3.org/TR/2010/REC-xquery-20101214/#id-version-declaration https://www.w3.org/TR/2010/REC-xquery-20101214/#id-version-declaration https://www.w3.org/TR/xquery-30/#id-version-declaration https://www.w3.org/TR/xquery-30/#id-version-declaration — Reply to this email directly, view it on GitHub https://github.com/w3c/qt3tests/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASIQIR5RK5SPVX6SGQYOA3VPC42NANCNFSM5YYOO6PQ. You are receiving this because you are subscribed to this thread.

michaelhkay commented 2 years ago

Closing this bug; I think the test cases are correct. Where the test has a dependency on XQ10, a processor must either run the test and deliver the result given in the XQuery 1.0 specification, or it should not run that test.