Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 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 2 years ago.
patch file
josm_validator_numeric_unit_abb_v2.patch (13.0 KB) - added by skyper 2 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 2 years ago.
version 3, combine test without autofix

Download all attachments as: .zip

Change History (15)

comment:1 Changed 2 years ago by skyper

Description: modified (diff)

Changed 2 years ago by skyper

patch file

comment:2 Changed 2 years ago by skyper

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

comment:3 Changed 2 years ago by skyper

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 2 years ago by skyper (previous) (diff)

Changed 2 years ago by skyper

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

comment:4 Changed 2 years ago by skyper

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 2 years ago by skyper (previous) (diff)

Changed 2 years ago by skyper

version 3, combine test without autofix

comment:5 Changed 2 years ago by simon04

Cc: Klumbumbus added
Milestone: 20.05

@Klumbumbus, could you review this patch, please?

comment:6 Changed 2 years ago by Klumbumbus

Yes.

comment:7 Changed 2 years ago by skyper

Description: modified (diff)

comment:8 Changed 2 years ago by skyper

Description: modified (diff)

comment:9 Changed 2 years ago by Klumbumbus

Milestone: 20.0520.06

comment:10 Changed 2 years ago by Klumbumbus

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 Changed 2 years ago by Klumbumbus

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

(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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.