Skip to content

JSONata comparison and date picture cases differ from jsonata.js 1.8.4 #464

Open

Description

@DicksonWu654

I found some conformance differences in valid JSONata expressions and date pictures. I tested the published 3.0.0 artifact and master at commit 8accd6f8a8f4fc0eeb87c808dd5dfadde2a5c106.

The README says the Java port targets jsonata.js 1.8.4, and these cases are in that release's test suite.

The comparison rules distinguish null from an empty sequence and compare arrays by their members:

  • comparison-operators/deep-equals.json case 15: null = nothing with input {} should return false, but returns true.
  • comparison-operators/deep-equals.json case 5: data = [1, 2, 3, 4] with input {"data":[1,2,3,4]} should return true, but returns false. A literal [1,2] = [1,2] does return true.

The $fromMillis picture rules support escaped brackets and week and month components:

  • function-fromMillis/formatDateTime.json case 7: $fromMillis(1521801216617, '[[Year]]: [[[Y0001]]]') should return [Year]: [2018], but returns [Year]: [2018.
  • function-fromMillis/formatDateTime.json case 59: $fromMillis(1359460800000, 'Week: [w] of [xNn]') should return Week: 5 of January, but throws ArrayIndexOutOfBoundsException: Index -2 out of bounds for length 12. Cases 60 through 65 in the same file use the same picture and also throw instead of returning their expected week and month strings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions