@@ -22,7 +22,7 @@ def test():
22
22
23
23
parser = soong .Parser ()
24
24
result = parser .parse (iter (tokens ))
25
- assert len (result ) == 6
25
+ assert len (result ) == 7
26
26
27
27
assert result [0 ].is_assignment ()
28
28
assert result [0 ].to_str () == '''sample_array = [
@@ -55,8 +55,8 @@ def test():
55
55
filtered = copy .deepcopy (ast )
56
56
filtered .filter (lambda x : not (x .is_scope () and x .is_dev ()))
57
57
assert type (filtered ) is soong .Ast
58
- assert len (filtered ) == 4
59
- assert filtered == ast [:4 ]
58
+ assert len (filtered ) == 5
59
+ assert filtered == ast [:4 ] + [ ast [ 6 ]]
60
60
61
61
map = filtered [1 ].map
62
62
assert 'cflags' in map
@@ -66,6 +66,15 @@ def test():
66
66
map ['array' ].filter (lambda x : x != '-short' )
67
67
assert len (map ['array' ]) == 1
68
68
69
+ custom = filtered [4 ].map
70
+ assert 'whole_static_libs' in custom
71
+ custom ['whole_static_libs' ].filter (lambda x : x .str_op (lambda y : 'gtest' not in y .lower ()))
72
+ assert custom ['whole_static_libs' ] == ['libz' ]
73
+
74
+ assert 'host_ldlibs' in custom
75
+ custom ['host_ldlibs' ].filter (lambda x : x .str_op (lambda y : 'gtest' not in y .lower ()))
76
+ assert custom ['host_ldlibs' ] == []
77
+
69
78
70
79
def test_addition ():
71
80
path = os .path .join (TEST_DIR , 'Addition.bp' )
0 commit comments