#19163 closed enhancement (fixed)
[Patch] Updates for tests on units
Reported by: | skyper | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.06 |
Component: | Core validator | Version: | |
Keywords: | template_report unit | Cc: | Klumbumbus |
Description (last modified by )
Please, find attached patch file: josm_validator_numeric_unit_abb.patch
which:
- adds test about long forms of common units and autofixes them to abbreviations:
m
,ft
andt
- combines the test for separator and the general warning to one for each group instead of one for each tag
- adds
maxaxleload
andmaxlength
to the tests
I was wondering why the regex for width
differs compared to the other tags but did not change it, so far:
Edit: I changed it.
*[width][width !~ /^(([0-9]+\.?[0-9]*( [a-z]+)?)|([0-9]+\'([0-9]+\.?[0-9]*\")?))$/]
instead of:
*[width][width !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-04-25 18:33:44 +0200 (Sat, 25 Apr 2020) Revision:16382 Build-Date:2020-04-26 01:30:47 URL:https://josm.openstreetmap.de/svn/trunk
Attachments (3)
Change History (15)
comment:1 Changed 3 years ago by
Description: | modified (diff) |
---|
Changed 3 years ago by
Attachment: | josm_validator_numeric_unit_abb.patch added |
---|
comment:2 Changed 3 years ago by
Summary: | [Patch] unit test updates → [Patch] Updates for tests on units |
---|
comment:3 Changed 3 years ago by
Summary: | [Patch] Updates for tests on units → [WIP-Patch] Updates for tests on units |
---|
Oh, that was too fast:
tons
should probably not be abbreviated, for now, as we loose information. Probably, the territory needs to be checked to distinguish between the two different tonnes and tons.- autofix does not proper work. Maybe combining the test was not a smart idea.
- check for separator for
maxlength
andmaxaxleload
is missing
Changed 3 years ago by
Attachment: | josm_validator_numeric_unit_abb_v2.patch added |
---|
version 2: no combinations of test, no "weight" so far
comment:4 Changed 3 years ago by
Summary: | [WIP-Patch] Updates for tests on units → [Patch] Updates for tests on units |
---|
Ok, please find josm_validator_numeric_unit_abb_v2.patch:
- harmonizes test for
width
to be in sync with other "length" tags - adds
maxaxleload
andmaxlength
to the tests - adds test about long forms of "length" units and autofixes them to abbreviations:
m
andft
No tests for "weight" units, so far.
Changed 3 years ago by
Attachment: | josm_validator_numeric_unit_abb_v3.patch added |
---|
version 3, combine test without autofix
comment:5 Changed 3 years ago by
Cc: | Klumbumbus added |
---|---|
Milestone: | → 20.05 |
@Klumbumbus, could you review this patch, please?
comment:7 Changed 3 years ago by
Description: | modified (diff) |
---|
comment:8 Changed 3 years ago by
Description: | modified (diff) |
---|
comment:9 Changed 3 years ago by
Milestone: | 20.05 → 20.06 |
---|
comment:11 Changed 3 years ago by
Please don't mix object types in asserts (node, way, relation) with different values to test. This makes it harder to read the asserts and for * selectors it makes no sense anyway.
comment:12 Changed 3 years ago by
(I unified the assert object types, added a few and adjusted the warning text.)
patch file