From 52aafc3af6692b64bf3d550bed0e7d9b5e7f8b11 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 20 Aug 2026 16:20:19 -0500 Subject: [PATCH 1/2] Drop the escaping test superseded by the shared ninja module tests --- tests/unit_tests/build_gen/test_arduino8266.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tests/unit_tests/build_gen/test_arduino8266.py b/tests/unit_tests/build_gen/test_arduino8266.py index 3baa54fa7d..522eca4f16 100644 --- a/tests/unit_tests/build_gen/test_arduino8266.py +++ b/tests/unit_tests/build_gen/test_arduino8266.py @@ -403,19 +403,6 @@ def test_project_flags_requotes_lexed_defines() -> None: assert compile_flags == ['"-DGREETING=hello world"'] -def test_shell_token_escaping() -> None: - """Tokens survive both POSIX sh and the Windows CRT argv parser.""" - assert arduino8266._shell_token("-Os") == "-Os" - # $ would be expanded (to nothing) by ninja itself - assert arduino8266._shell_token("-DX=$HOME") == "-DX=$$HOME" - # Backslashes not before a quote stay single (Windows path in a define) - assert arduino8266._shell_token("-DP=C:\\x y") == '"-DP=C:\\x y"' - # A quote is escaped and the preceding backslash run doubles - assert arduino8266._shell_token('-DX=a\\"b c') == '"-DX=a\\\\\\"b c"' - # A trailing backslash run doubles before the closing quote - assert arduino8266._shell_token("a b\\") == '"a b\\\\"' - - def test_flag_defines_joins_spaced_define() -> None: """A spaced "-D KNOB" entry is detected exactly as PlatformIO detects it.""" _set_flags("-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH") From 360c51329c5ba915a887d257c47cfbf6ef8054b9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 20 Aug 2026 16:20:37 -0500 Subject: [PATCH 2/2] Cover the native-toolchain predicate --- tests/unit_tests/test_core.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit_tests/test_core.py b/tests/unit_tests/test_core.py index 7adf955217..7964528665 100644 --- a/tests/unit_tests/test_core.py +++ b/tests/unit_tests/test_core.py @@ -958,6 +958,17 @@ class TestEsphomeCore: target.toolchain = const.Toolchain.ESP_IDF assert target.using_toolchain_sdk_nrf is False + def test_using_native_toolchain(self, target): + """True exactly for the toolchains that never read platformio.ini.""" + target.toolchain = const.Toolchain.ESP_IDF + assert target.using_native_toolchain is True + target.toolchain = const.Toolchain.ARDUINO + assert target.using_native_toolchain is True + target.toolchain = const.Toolchain.PLATFORMIO + assert target.using_native_toolchain is False + target.toolchain = const.Toolchain.SDK_NRF + assert target.using_native_toolchain is False + def test_add_library__extracts_short_name_from_path(self, target): """Test add_library extracts short name from library paths like owner/lib.""" target.data[const.KEY_CORE] = {