Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#159 closed defect (fixed)

Errors in UCUM Functional Tests

Reported by: Ferdinand Beyer Owned by:
Priority: major Milestone:
Component: Keywords: functional tests
Cc:

Description

You provide a set of functional tests for UCUM implementations: http://unitsofmeasure.org/trac/wiki/FunctionalTests

I found that some of these tests contradict the specification:

  • 1-115 to 1-119: Unicode characters are forbidden by the specification §3 (1).
  • 1-116 to 1-118: Annotations are not allowed on integer numbers and Annotations do signify the end of a unit symbol as of §6 (3).
  • 1-249 to 1-252, 1-275, 1-337 claim to be invalid although [IU] is a valid unit according to the tables.
  • 3-108 to 3-111 expect wrong values since the test assumes right-to-left evaluation order. For example, 3-108 converts 6.3 from "s/m/g" to "s.m-1.g", and expects "6.3". According to the specification, §7 (4), Terms are evaluated from left to right with the period and the solidus having the same operator precedence, so that the conversion should fail: "s/m/g" = "(s/m)/g", "s.m-1.g" = "(s.m-1).g" = "(s/m).g".

To summarize: Implementations that pass all these tests are not UCUM-conform.

Change History (3)

comment:1 Changed 6 years ago by Gunther Schadow

These functional tests have been contributed by Grahame Grieve. We don't maintain them. I will reach out to him.

comment:2 Changed 6 years ago by Grahame Grieve

Resolution: fixed
Status: newclosed

"Annotations are not allowed on integer numbers" - don't agree. The specification says "An annotation without a leading symbol implies the default unit 1 (the unity)" - so it's valid on the number 1, which is what the tests have, though not any other number.

I'll upload a fixed version for the other issues

comment:3 Changed 6 years ago by Gunther Schadow

The grammar issue may be the following:

"{foo}" = 1 1 (unity) "4{foo}" = 4 1 (unity)

if simple numbers are allowed as units "1" is but what about "4"?

This is connected with the syntax review in #158, #54, and #4.

Note: See TracTickets for help on using tickets.