diff options
author | 2024-04-02 16:45:54 -0700 | |
---|---|---|
committer | 2024-04-04 11:24:24 -0700 | |
commit | 683316a2b02f2f84ce3b9403b12c1c30cb262770 (patch) | |
tree | e851fc15adf3cd5019af896902dc35c624006ca7 | |
parent | 767a1fe663dbad63bad7592bc57703a7e161d32a (diff) |
Rename default select branch to 'default' keyword
Previously I was using an underscore to denote the default branch
because I was thinking that I would allow variable bindings in the
select branches, and 'default' could be mistaken for the name of a
variable. But I think it's better to just introduce alternate syntax,
like `default @ my_var: "foo" + my_var,` to do the variable bindings,
so that we can have a clearer name for the default case.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I8cbded97a029c06782fb5313d8c0e67f22951482
-rw-r--r-- | android/selects_test.go | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/android/selects_test.go b/android/selects_test.go index f57fb4218..a54459c10 100644 --- a/android/selects_test.go +++ b/android/selects_test.go @@ -39,7 +39,7 @@ func TestSelects(t *testing.T) { my_string_list: select(soong_config_variable("my_namespace", "my_variable"), { "a": ["a.cpp"], "b": ["b.cpp"], - _: ["c.cpp"], + default: ["c.cpp"], }), } `, @@ -55,7 +55,7 @@ func TestSelects(t *testing.T) { my_string: select(soong_config_variable("my_namespace", "my_variable"), { "a": "a.cpp", "b": "b.cpp", - _: "c.cpp", + default: "c.cpp", }), } `, @@ -71,7 +71,7 @@ func TestSelects(t *testing.T) { my_bool: select(soong_config_variable("my_namespace", "my_variable"), { "a": true, "b": false, - _: true, + default: true, }), } `, @@ -87,7 +87,7 @@ func TestSelects(t *testing.T) { my_paths: select(soong_config_variable("my_namespace", "my_variable"), { "a": ["foo.txt"], "b": ["bar.txt"], - _: ["baz.txt"], + default: ["baz.txt"], }), } `, @@ -103,7 +103,7 @@ func TestSelects(t *testing.T) { my_paths: select(soong_config_variable("my_namespace", "my_variable"), { "a": [":a"], "b": [":b"], - _: [":c"], + default: [":c"], }), } `, @@ -117,7 +117,7 @@ func TestSelects(t *testing.T) { my_string: select(soong_config_variable("my_namespace", "my_variable"), { "a": "a.cpp", "b": true, - _: "c.cpp", + default: "c.cpp", }), } `, @@ -131,7 +131,7 @@ func TestSelects(t *testing.T) { my_string: select(soong_config_variable("my_namespace", "my_variable"), { "a": false, "b": true, - _: true, + default: true, }), } `, @@ -145,7 +145,7 @@ func TestSelects(t *testing.T) { my_string_list: select(soong_config_variable("my_namespace", "my_variable"), { "a": ["a.cpp"], "b": ["b.cpp"], - _: ["c.cpp"], + default: ["c.cpp"], }), } `, @@ -166,11 +166,11 @@ func TestSelects(t *testing.T) { my_string_list: select(soong_config_variable("my_namespace", "my_variable"), { "a": ["a.cpp"], "b": ["b.cpp"], - _: ["c.cpp"], + default: ["c.cpp"], }) + select(soong_config_variable("my_namespace", "my_variable_2"), { "a2": ["a2.cpp"], "b2": ["b2.cpp"], - _: ["c2.cpp"], + default: ["c2.cpp"], }), } `, @@ -191,7 +191,7 @@ func TestSelects(t *testing.T) { my_string_list: ["literal.cpp"] + select(soong_config_variable("my_namespace", "my_variable"), { "a2": ["a2.cpp"], "b2": ["b2.cpp"], - _: ["c2.cpp"], + default: ["c2.cpp"], }), } `, @@ -207,7 +207,7 @@ func TestSelects(t *testing.T) { my_string_list: select(soong_config_variable("my_namespace", "my_variable"), { "a2": ["a2.cpp"], "b2": ["b2.cpp"], - _: ["c2.cpp"], + default: ["c2.cpp"], }) + ["literal.cpp"], } `, @@ -223,7 +223,7 @@ func TestSelects(t *testing.T) { my_bool: select(soong_config_variable("my_namespace", "my_variable"), { "a": true, "b": false, - _: true, + default: true, }) + false, } `, @@ -239,7 +239,7 @@ func TestSelects(t *testing.T) { my_bool: select(soong_config_variable("my_namespace", "my_variable"), { "a": true, "b": false, - _: true, + default: true, }) + false, } `, @@ -260,7 +260,7 @@ func TestSelects(t *testing.T) { my_string: select(soong_config_variable("my_namespace", "my_variable"), { "a": "a", "b": "b", - _: "c", + default: "c", }) + ".cpp", } `, @@ -278,7 +278,7 @@ func TestSelects(t *testing.T) { "x86_64": "my_x86_64", "arm": "my_arm", "arm64": "my_arm64", - _: "my_default", + default: "my_default", }), } `, @@ -294,7 +294,7 @@ func TestSelects(t *testing.T) { my_string: select(soong_config_variable("my_namespace", "my_variable"), { "a": unset, "b": "b", - _: "c", + default: "c", }) } `, @@ -313,7 +313,7 @@ func TestSelects(t *testing.T) { my_string: select(soong_config_variable("my_namespace", "my_variable"), { "a": unset, "b": "b", - _: "c", + default: "c", }) } `, @@ -327,9 +327,9 @@ func TestSelects(t *testing.T) { my_module_type { name: "foo", my_string: select(soong_config_variable("my_namespace", "my_variable"), { - _: unset, + default: unset, }) + select(soong_config_variable("my_namespace", "my_variable2"), { - _: unset, + default: unset, }) } `, @@ -341,9 +341,9 @@ func TestSelects(t *testing.T) { my_module_type { name: "foo", my_string: select(soong_config_variable("my_namespace", "my_variable"), { - _: unset, + default: unset, }) + select(soong_config_variable("my_namespace", "my_variable2"), { - _: "a", + default: "a", }) } `, @@ -358,9 +358,9 @@ func TestSelects(t *testing.T) { name: "foo", my_bool: select(soong_config_variable("my_namespace", "my_variable"), { "a": true, - _: unset, + default: unset, }) + select(soong_config_variable("my_namespace", "my_variable2"), { - _: true, + default: true, }) } `, |