Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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 skyper)

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 and t
  • combines the test for separator and the general warning to one for each group instead of one for each tag
  • adds maxaxleload and maxlength 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)

josm_validator_numeric_unit_abb.patch (11.3 KB ) - added by skyper 4 years ago.
patch file
josm_validator_numeric_unit_abb_v2.patch (13.0 KB ) - added by skyper 4 years ago.
version 2: no combinations of test, no "weight" so far
josm_validator_numeric_unit_abb_v3.patch (13.2 KB ) - added by skyper 4 years ago.
version 3, combine test without autofix

Download all attachments as: .zip

Change History (15)

comment:1 by skyper, 4 years ago

Description: modified (diff)

by skyper, 4 years ago

patch file

comment:2 by skyper, 4 years ago

Summary: [Patch] unit test updates[Patch] Updates for tests on units

comment:3 by skyper, 4 years ago

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 and maxaxleload is missing
Last edited 4 years ago by skyper (previous) (diff)

by skyper, 4 years ago

version 2: no combinations of test, no "weight" so far

comment:4 by skyper, 4 years ago

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 and maxlength to the tests
  • adds test about long forms of "length" units and autofixes them to abbreviations: m and ft

No tests for "weight" units, so far.

Last edited 4 years ago by skyper (previous) (diff)

by skyper, 4 years ago

version 3, combine test without autofix

comment:5 by simon04, 4 years ago

Cc: Klumbumbus added
Milestone: 20.05

@Klumbumbus, could you review this patch, please?

comment:6 by Klumbumbus, 4 years ago

Yes.

comment:7 by skyper, 4 years ago

Description: modified (diff)

comment:8 by skyper, 4 years ago

Description: modified (diff)

comment:9 by Klumbumbus, 4 years ago

Milestone: 20.0520.06

comment:10 by Klumbumbus, 4 years ago

Resolution: fixed
Status: newclosed

In 16685/josm:

fix #19163 - Adjust units validator tests: add autofixes for missing or multiple spaces and long forms of units, validate maxaxleload and maxlength too (patch by skyper, modified)

comment:11 by Klumbumbus, 4 years ago

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 by Klumbumbus, 4 years ago

(I unified the assert object types, added a few and adjusted the warning text.)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.