Opened 6 years ago

Last modified 6 years ago

#19163 closed enhancement

[Patch] Updates for tests on units — at Version 8

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

Change History (11)

comment:1 by skyper, 6 years ago

Description: modified (diff)

by skyper, 6 years ago

patch file

comment:2 by skyper, 6 years ago

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

comment:3 by skyper, 6 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 6 years ago by skyper (previous) (diff)

by skyper, 6 years ago

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

comment:4 by skyper, 6 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 6 years ago by skyper (previous) (diff)

by skyper, 6 years ago

version 3, combine test without autofix

comment:5 by simon04, 6 years ago

Cc: Klumbumbus added
Milestone: 20.05

@Klumbumbus, could you review this patch, please?

comment:6 by Klumbumbus, 6 years ago

Yes.

comment:7 by skyper, 6 years ago

Description: modified (diff)

comment:8 by skyper, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.