#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 8 years ago by
comment:2 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
"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 8 years ago by
Note: See
TracTickets for help on using
tickets.
These functional tests have been contributed by Grahame Grieve. We don't maintain them. I will reach out to him.