Opened 3 weeks ago
Closed 2 weeks ago
#25026 closed task (wontfix)
[Test] Add unit tests for TagCheckerTest
| Reported by: | Owned by: | team | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core | Version: | |
| Keywords: | Cc: |
Description
added new test cases for 'tryGuess'
Attachments (2)
Change History (10)
by , 3 weeks ago
| Attachment: | #25026-Test-Add-unit-tests-for-TagCheckerTest.patch added |
|---|
follow-up: 2 comment:1 by , 3 weeks ago
comment:2 by , 3 weeks ago
Replying to GerdP:
Thanks. Please explain what you want to test with
testTryGuessIgnoredKey(). My understanding is that it tests the data configured in ignoretags.cfg, fieldignoreForLevenshteinis not involved.
This test verifies that keys on the ignore list (in this case, "name") are skipped during typo detection, ensuring that no warning is issued despite the intentional misspelling ("Residentail").
follow-up: 4 comment:3 by , 3 weeks ago
Sorry, are you a robot or do you just use AI to generate the code? Why does the comment mention field ignoreForLevenshtein?
comment:4 by , 3 weeks ago
Replying to GerdP:
Sorry, are you a robot or do you just use AI to generate the code? Why does the comment mention field
ignoreForLevenshtein?
No, I am not a robot. I do, however, use AI assistance in certain instances and occasionally experiment with new approaches.
The method testTryGuessIgnoredKey() is intended to ensure that keys included in the exclusion list ignoreForLevenshtein are skipped during this typo-checking process. For free-text fields—such as those used for names—an automatic correction would frequently be incorrect.
comment:5 by , 3 weeks ago
Please double check. Method isKeyIgnored() already returns true for key name. The collection ignoreForLevenshtein should only contain keys like couplings or climbing:length:max as those keys appear in the presets with lists of numerical values.
by , 3 weeks ago
| Attachment: | #25026-Test-Add-unit-tests-for-TagCheckerTest.2.patch added |
|---|
comment:7 by , 3 weeks ago
Sorry, should have asked this earlier: Some of the new tests seem to repeat already existing tests, e.g. testTryGuessSingleLevenshteinMatch() checks the tag highway=residentail. This tag is already in the unit test. Same with surface=u.
(lines 99 and 105)
Similar your test with highway=radh seems to cover the same code as the existing highway=servics.
So I wonder why you think that those additional tests are needed.
comment:8 by , 2 weeks ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Yes, I agree. The new tests are already covered by the existing ones and ultimately provide no added value. Therefore, the ticket will be closed.



Thanks. Please explain what you want to test with
testTryGuessIgnoredKey(). My understanding is that it tests the data configured in ignoretags.cfg, fieldignoreForLevenshteinis not involved.