mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 19:06:37 +00:00
Re-glue spaced -D tokens so knob defines are detected like PlatformIO
This commit is contained in:
@@ -538,5 +538,9 @@ def test_split_flag_entry_unbalanced_quote_is_clean() -> None:
|
||||
from esphome.platformio.library import split_flag_entry
|
||||
|
||||
assert split_flag_entry('-DX="a b"', "library x") == ["-DX=a b"]
|
||||
# join_flag_args re-glues a spaced -D like ParseFlags does
|
||||
from esphome.platformio.library import join_flag_args
|
||||
|
||||
assert join_flag_args(["-D", "FOO=1", "-Os"], "x") == ["-DFOO=1", "-Os"]
|
||||
with pytest.raises(EsphomeError, match=r"Malformed build flag.*library x"):
|
||||
split_flag_entry('-DX="unclosed', "library x")
|
||||
|
||||
Reference in New Issue
Block a user