Skip to content

[tests] Remove unused color constants from the drules-mini fixture - #44

Merged
biodranik merged 1 commit into
masterfrom
ab/remove-unused-colors
Sep 4, 2026
Merged

biodranik merged 1 commit into
masterfrom
ab/remove-unused-colors

Conversation

@biodranik

Copy link
Copy Markdown
Member

What

Drops 19 color constants (21 lines) from the colors block of
tests/assets/case-2-generate-drules-mini/main.mapcss.

The fixture's colors block mirrors the Organic Maps app styles. Those styles no
longer define these constants — they were leftovers of removed features (local
ads, hotel prices and ratings, guides, UGC) and were referenced by no MapCSS
rule and no client code:

DefaultTrackColor, GuideCityMarkText, GuideOutdoorMarkText,
HotelPriceText, LocalAds{Primary,Secondary}Text{,Outline},
PoiHotelTextOutline, PoiVisitedMask, Rating{Bad,Good,None,Text},
Searchmark{NotAvailable,Preparing,SelectedNotAvailable},
TransitMarkSecondaryTextOutline, UGCRatingText.

Companion to the removal in organicmaps/organicmaps.

Testing

python3 -m unittest discover -s tests -t . — 57 tests, all pass.
test_generate_drules_mini() asserts on types.txt line/type counts and the
number of types with drawing rules, none of which involve the colors block.

The fixture's colors block mirrors the app styles, which no longer define these
19 constants: they were leftovers of removed features (local ads, hotel prices
and ratings, guides, UGC) and were referenced by no MapCSS rule or client code.

test_generate_drules_mini() asserts on type and drawing-rule counts only, so
its expectations are unaffected. All 57 tests pass.

Signed-off-by: Alexander Borsuk <me@alex.bio>
@biodranik
biodranik requested review from strump and vng August 31, 2026 10:37
@biodranik
biodranik merged commit 59a6bf4 into master Sep 4, 2026
2 checks passed
biodranik added a commit to organicmaps/organicmaps that referenced this pull request Sep 11, 2026
A forbidden [!key] in a mapcss-mapping.csv selector matches features
without the key, but kothic evaluated styles against key=no, which MapCSS
treats as set. Now such types can exclude tunnels without inheriting the
tunnel styles. The generated drawing rules do not change.

See organicmaps/kothic#46. The update also brings organicmaps/kothic#44,
which only touches kothic's tests.

Signed-off-by: Alexander Borsuk <me@alex.bio>
biodranik added a commit to organicmaps/organicmaps that referenced this pull request Sep 12, 2026
A forbidden [!key] in a mapcss-mapping.csv selector matches features
without the key, but kothic evaluated styles against key=no, which MapCSS
treats as set. Now such types can exclude tunnels without inheriting the
tunnel styles. The generated drawing rules do not change.

See organicmaps/kothic#46. The update also brings organicmaps/kothic#44,
which only touches kothic's tests.

Signed-off-by: Alexander Borsuk <me@alex.bio>
biodranik added a commit to organicmaps/organicmaps that referenced this pull request Sep 12, 2026
A forbidden [!key] in a mapcss-mapping.csv selector matches features
without the key, but kothic evaluated styles against key=no, which MapCSS
treats as set. Now such types can exclude tunnels without inheriting the
tunnel styles. The generated drawing rules do not change.

See organicmaps/kothic#46. The update also brings organicmaps/kothic#44,
which only touches kothic's tests.

Signed-off-by: Alexander Borsuk <me@alex.bio>
biodranik added a commit to organicmaps/organicmaps that referenced this pull request Sep 14, 2026
A forbidden [!key] in a mapcss-mapping.csv selector matches features
without the key, but kothic evaluated styles against key=no, which MapCSS
treats as set. Now such types can exclude tunnels without inheriting the
tunnel styles. The generated drawing rules do not change.

See organicmaps/kothic#46. The update also brings organicmaps/kothic#44,
which only touches kothic's tests.

Signed-off-by: Alexander Borsuk <me@alex.bio>
biodranik added a commit to organicmaps/organicmaps that referenced this pull request Sep 19, 2026
No code requests these named colors anymore: their users (local ads,
Booking/guides/UGC marks, visited POI mask, hotel text outline, the old
default track color, the transit secondary text outline) were removed
earlier. The kothic test fixture already dropped them in
organicmaps/kothic#44.

Signed-off-by: Alexander Borsuk <me@alex.bio>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants