def test_style_update_with_var_data():
    """Test that .update with a Style containing VarData works."""
    red_var = LiteralVar.create("red")._replace(
        merge_var_data=VarData(hooks={"const red = true": None}),
    )
    blue_var = LiteralVar.create("blue")._replace(
        merge_var_data=VarData(hooks={"const blue = true": None}),
    )

    s1 = Style(
        {
            "color": red_var,
        }
    )
    s2 = Style()
    s2.update(s1, background_color=f"{blue_var}ish")
    assert str(LiteralVar.create(s2)) == str(
        LiteralVar.create({"color": "red", "backgroundColor": "blueish"})
    )
    assert s2._var_data is not None
    assert "const red = true" in s2._var_data.hooks
    assert "const blue = true" in s2._var_data.hooks

    s3 = s1 | s2
    assert s3._var_data is not None
    assert "_varData" not in s3
Test that .update with a Style containing VarData works.
tests/units/test_style.py