@@ -55,8 +55,8 @@ def ReadMatterIdl(repo_path: str) -> str:
55
55
return stream .read ()
56
56
57
57
58
- def ParseMatterIdl (repo_path : str , skip_meta : bool ) -> Idl :
59
- return CreateParser (skip_meta = skip_meta ).parse (ReadMatterIdl (repo_path ))
58
+ def ParseMatterIdl (repo_path : str , skip_meta : bool , merge_globals : bool ) -> Idl :
59
+ return CreateParser (skip_meta = skip_meta , merge_globals = merge_globals ).parse (ReadMatterIdl (repo_path ))
60
60
61
61
62
62
def RenderAsIdlTxt (idl : Idl ) -> str :
@@ -106,8 +106,10 @@ def test_client_clusters(self):
106
106
# Files MUST be identical except the header comments which are different
107
107
original = SkipLeadingComments (ReadMatterIdl (path ), also_strip = [
108
108
" // NOTE: Default/not specifically set" ])
109
+ # Do not merge globals because ZAP generated matter files do not contain
110
+ # the merge global data (will not render global reference comments).
109
111
generated = SkipLeadingComments (RenderAsIdlTxt (
110
- ParseMatterIdl (path , skip_meta = False )))
112
+ ParseMatterIdl (path , skip_meta = False , merge_globals = False )))
111
113
112
114
self .assertTextEqual (original , generated )
113
115
@@ -126,9 +128,9 @@ def test_app_rendering(self):
126
128
]
127
129
128
130
for path in test_paths :
129
- idl = ParseMatterIdl (path , skip_meta = True )
131
+ idl = ParseMatterIdl (path , skip_meta = True , merge_globals = True )
130
132
txt = RenderAsIdlTxt (idl )
131
- idl2 = CreateParser (skip_meta = True ).parse (txt )
133
+ idl2 = CreateParser (skip_meta = True , merge_globals = True ).parse (txt )
132
134
133
135
# checks that data types and content is the same
134
136
self .assertEqual (idl , idl2 )
0 commit comments