Skip to content
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

[BUG] an edge case testing for negative durations fails #3514

Open
line-o opened this issue Aug 25, 2020 · 0 comments
Open

[BUG] an edge case testing for negative durations fails #3514

line-o opened this issue Aug 25, 2020 · 0 comments
Labels
bug issue confirmed as bug xquery issue is related to xquery implementation

Comments

@line-o
Copy link
Member

line-o commented Aug 25, 2020

Describe the bug

Testing for negative durations can be achieved by testing if the duration is smaller than a zero second duration.
The following queries returns false() in existdb 5.3.0-SNAPSHOT:

xs:dayTimeDuration("-PT0.1S") < xs:dayTimeDuration("PT0S"),
xs:dayTimeDuration("-PT0.1S") < xs:dayTimeDuration("PT0.1S")

These tests however work as expected:

xs:dayTimeDuration("-PT0.1S") < xs:dayTimeDuration("PT1S"),
xs:dayTimeDuration("-PT1S") < xs:dayTimeDuration("PT0S")

Expected behavior

The above query to return true().
Saxon 10HE does return true().

To Reproduce

xquery version "3.1";

module namespace t="http://exist-db.org/xquery/test";

declare namespace test="http://exist-db.org/xquery/xqsuite";

declare
    %test:assertTrue
function t:test() {
    xs:dayTimeDuration("-PT0.1S") < xs:dayTimeDuration("PT0S")
};

Context (please always complete the following information):

  • OS: macOS 10.15.6
  • eXist-db version: 5.3.0-SNAPSHOT
  • Java Version: openjdk version "1.8.0_252"

Additional context

  • How is eXist-db installed? from source (748d916)
  • Any custom changes in e.g. conf.xml? only http(s) ports
@line-o line-o added bug issue confirmed as bug xquery issue is related to xquery implementation labels Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug xquery issue is related to xquery implementation
Projects
None yet
Development

No branches or pull requests

1 participant