Overview
| Artifact ID: | 7f4cd78874a3d3ba7e77edc3b77120d5963f55ed |
|---|---|
| Ticket: | e7a722cd3573fedda5d1e528f95902776f996e06
confusing precedence of some clock-formats by `clock scan -format` |
| User & Date: | sebres on 2016-12-19 15:21:31 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
IMHO the calculating of precedence and therefore several test cases (e.g. clock-11.x with very confusing and absurdly logic) are wrong. Example: ``` # from clock-11.1: puts [set d [clock scan {1970-01-01 002} -format "%Y-%m-%d %j" -gmt 1]]\t[clock format $d -format "%Y-%m-%d %j"] # from clock-11.4: puts [set d [clock scan {002 1970-01-01} -format "%j %Y-%m-%d" -gmt 1]]\t[clock format $d -format "%Y-%m-%d %j"] # returns accordingly: 86400 1970-01-02 002 0 1970-01-01 001 ``` But according to `DateParseActions` both "%Y%m%d" and "%Y%j" have the same priority! (but "%Y%m%d" takes place always before "%Y%j"): ``` { century yearOfCentury month dayOfMonth } 3 { ... } { century yearOfCentury dayOfYear } 3 { ... } ... { yearOfCentury month dayOfMonth } 4 { ... } { yearOfCentury dayOfYear } 4 { ... } ``` That is IMHO definitive a bug within `MakeParseCodeFromFields` - because if both formats have the same priority, it should return the same result (likely "%Y%m%d" should wins in both cases). At least this logic used in ALL other test cases (e. g. in simplified terms if "month" available "mmdd" over "ddd", otherwise "ddd" over "dd"). It's worse still more that in first case wins prio.3 with "%Y%j" (so second rule!), in second case - prio.4 with "%Y%m%d" (so totally ignores both prio.3 rules)... I think, as result of this confusing bug, several test cases have been artificially made "correctly". P.S. Request for the fast feedback, because I'm working on newer tcl-clock engine and this is important for me, because my decision rules here are logic-based (not priority-based). - foundin changed to: "all"
- is_private changed to: "0"
- login: "sebres"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "sebres"
- subsystem changed to: "16. Commands A-H"
- title changed to:
confusing precedence of some clock-formats by `clock scan -format`
- type changed to: "Bug"