Modify ↓

Opened 3 weeks ago

Closed 2 weeks ago

#25026 closed task (wontfix)

[Test] Add unit tests for TagCheckerTest

Reported by: DanProgs <Abenteurer.2901@…> Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

added new test cases for 'tryGuess'

Attachments (2)

#25026-Test-Add-unit-tests-for-TagCheckerTest.patch​ (5.4 KB ) - added by DanProgs <Abenteurer.2901@…> 3 weeks ago.
#25026-Test-Add-unit-tests-for-TagCheckerTest.2.patch​ (5.2 KB ) - added by DanProgs <Abenteurer.2901@…> 3 weeks ago.

Download all attachments as: .zip

Change History (10)

by DanProgs <Abenteurer.2901@…>, 3 weeks ago

comment:1 by GerdP, 3 weeks ago

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

in reply to:  1 comment:2 by DanProgs <Abenteurer.2901@…>, 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, field ignoreForLevenshtein is 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").

comment:3 by GerdP, 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?

in reply to:  3 comment:4 by DanProgs <Abenteurer.2901@…>, 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 GerdP, 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.

comment:6 by DanProgs <Abenteurer.2901@…>, 3 weeks ago

OK, thanks. Here is the correction.

by DanProgs <Abenteurer.2901@…>, 3 weeks ago

comment:7 by GerdP, 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 DanProgs <Abenteurer.2901@…>, 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.

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.