Drop the never-hitting parse memo, guard the post-compile idedata refresh, pin the kind map

This commit is contained in:
J. Nick Koston
2026-08-20 18:40:29 -05:00
parent bc6b997350
commit 790c6d6353
4 changed files with 59 additions and 15 deletions
@@ -564,3 +564,15 @@ def test_split_flag_entry_non_string_is_clean() -> None:
split_flag_entry({"esp32": ["-DX"]}, "lib x")
with pytest.raises(EsphomeError, match="Malformed build flag 5"):
split_flag_entry(5, "lib x")
def test_source_kind_map_shape() -> None:
"""The kind values the native compile rules key on, and the deliberate
AS/ASPP merge (.s and .S both map to asm)."""
from esphome.platformio.library import SOURCE_KIND_FOR_SUFFIX
assert set(SOURCE_KIND_FOR_SUFFIX.values()) == {"c", "cxx", "asm"}
assert SOURCE_KIND_FOR_SUFFIX[".s"] == "asm"
assert SOURCE_KIND_FOR_SUFFIX[".S"] == "asm"
assert SOURCE_KIND_FOR_SUFFIX[".c"] == "c"
assert SOURCE_KIND_FOR_SUFFIX[".cpp"] == "cxx"