@@ -85,104 +85,144 @@ class _AssetGraphMatcher extends Matcher {
8585 ];
8686 matches = false ;
8787 }
88- if (node is NodeWithInputs ) {
89- if (expectedNode is NodeWithInputs ) {
90- if (node.state != expectedNode.state) {
91- matchState['needsUpdate of ${node .id }' ] = [
92- node.state,
93- expectedNode.state,
88+ if (node.type == NodeType .generated) {
89+ if (expectedNode.type == NodeType .generated) {
90+ final configuration = node.generatedNodeConfiguration;
91+ final expectedConfiguration = expectedNode.generatedNodeConfiguration;
92+
93+ if (configuration.primaryInput !=
94+ expectedConfiguration.primaryInput) {
95+ matchState['primaryInput of ${node .id }' ] = [
96+ configuration.primaryInput,
97+ expectedConfiguration.primaryInput,
98+ ];
99+ matches = false ;
100+ }
101+
102+ final state = node.generatedNodeState;
103+ final expectedState = expectedNode.generatedNodeState;
104+
105+ if (state.pendingBuildAction != expectedState.pendingBuildAction) {
106+ matchState['pendingBuildAction of ${node .id }' ] = [
107+ state.pendingBuildAction,
108+ expectedState.pendingBuildAction,
94109 ];
95110 matches = false ;
96111 }
97- if (! unorderedEquals (node.inputs).matches (expectedNode.inputs, {})) {
112+ if (! unorderedEquals (
113+ state.inputs,
114+ ).matches (expectedState.inputs, {})) {
98115 matchState['Inputs of ${node .id }' ] = [
99- node.inputs,
100- expectedNode.inputs,
116+ state.inputs,
117+ expectedState.inputs,
118+ ];
119+ matches = false ;
120+ }
121+
122+ if (state.wasOutput != expectedState.wasOutput) {
123+ matchState['wasOutput of ${node .id }' ] = [
124+ state.wasOutput,
125+ expectedState.wasOutput,
126+ ];
127+ matches = false ;
128+ }
129+ if (state.isFailure != expectedState.isFailure) {
130+ matchState['isFailure of ${node .id }' ] = [
131+ state.isFailure,
132+ expectedState.isFailure,
133+ ];
134+ matches = false ;
135+ }
136+ if (checkPreviousInputsDigest &&
137+ state.previousInputsDigest !=
138+ expectedState.previousInputsDigest) {
139+ matchState['previousInputDigest of ${node .id }' ] = [
140+ state.previousInputsDigest,
141+ expectedState.previousInputsDigest,
101142 ];
102143 matches = false ;
103144 }
104145 }
105- if (node is GeneratedAssetNode ) {
106- if (expectedNode is GeneratedAssetNode ) {
107- if (node.primaryInput != expectedNode.primaryInput) {
108- matchState['primaryInput of ${node .id }' ] = [
109- node.primaryInput,
110- expectedNode.primaryInput,
111- ];
112- matches = false ;
113- }
114- if (node.wasOutput != expectedNode.wasOutput) {
115- matchState['wasOutput of ${node .id }' ] = [
116- node.wasOutput,
117- expectedNode.wasOutput,
118- ];
119- matches = false ;
120- }
121- if (node.isFailure != expectedNode.isFailure) {
122- matchState['isFailure of ${node .id }' ] = [
123- node.isFailure,
124- expectedNode.isFailure,
125- ];
126- matches = false ;
127- }
128- if (checkPreviousInputsDigest &&
129- node.previousInputsDigest !=
130- expectedNode.previousInputsDigest) {
131- matchState['previousInputDigest of ${node .id }' ] = [
132- node.previousInputsDigest,
133- expectedNode.previousInputsDigest,
134- ];
135- matches = false ;
136- }
146+ } else if (node.type == NodeType .glob) {
147+ if (expectedNode.type == NodeType .glob) {
148+ final state = node.globNodeState;
149+ final expectedState = expectedNode.globNodeState;
150+
151+ if (state.pendingBuildAction != expectedState.pendingBuildAction) {
152+ matchState['pendingBuildAction of ${node .id }' ] = [
153+ state.pendingBuildAction,
154+ expectedState.pendingBuildAction,
155+ ];
156+ matches = false ;
157+ }
158+ if (! unorderedEquals (
159+ state.inputs,
160+ ).matches (expectedState.inputs, {})) {
161+ matchState['Inputs of ${node .id }' ] = [
162+ state.inputs,
163+ expectedState.inputs,
164+ ];
165+ matches = false ;
166+ }
167+
168+ if (! unorderedEquals (
169+ state.results! ,
170+ ).matches (expectedState.results, {})) {
171+ matchState['results of ${node .id }' ] = [
172+ state.results,
173+ expectedState.results,
174+ ];
175+ matches = false ;
137176 }
138- } else if (node is GlobAssetNode ) {
139- if (expectedNode is GlobAssetNode ) {
140- if (! unorderedEquals (
141- node.results! ,
142- ).matches (expectedNode.results, {})) {
143- matchState['results of ${node .id }' ] = [
144- node.results,
145- expectedNode.results,
146- ];
147- matches = false ;
148- }
149- if (node.glob.pattern != expectedNode.glob.pattern) {
150- matchState['glob of ${node .id }' ] = [
151- node.glob.pattern,
152- expectedNode.glob.pattern,
153- ];
154- matches = false ;
155- }
177+
178+ final configuration = node.globNodeConfiguration;
179+ final expectedConfiguration = expectedNode.globNodeConfiguration;
180+ if (configuration.glob.pattern !=
181+ expectedConfiguration.glob.pattern) {
182+ matchState['glob of ${node .id }' ] = [
183+ configuration.glob.pattern,
184+ expectedConfiguration.glob.pattern,
185+ ];
186+ matches = false ;
156187 }
157188 }
158- } else if (node is PostProcessAnchorNode ) {
159- if (expectedNode is PostProcessAnchorNode ) {
160- if (node.actionNumber != expectedNode.actionNumber) {
189+ } else if (node.type == NodeType .postProcessAnchor) {
190+ if (expectedNode.type == NodeType .postProcessAnchor) {
191+ final nodeConfiguration = node.postProcessAnchorNodeConfiguration;
192+ final expectedNodeConfiguration =
193+ expectedNode.postProcessAnchorNodeConfiguration;
194+ if (nodeConfiguration.actionNumber !=
195+ expectedNodeConfiguration.actionNumber) {
161196 matchState['actionNumber of ${node .id }' ] = [
162- node .actionNumber,
163- expectedNode .actionNumber,
197+ nodeConfiguration .actionNumber,
198+ expectedNodeConfiguration .actionNumber,
164199 ];
165200 matches = false ;
166201 }
167- if (node.builderOptionsId != expectedNode.builderOptionsId) {
202+ if (nodeConfiguration.builderOptionsId !=
203+ expectedNodeConfiguration.builderOptionsId) {
168204 matchState['builderOptionsId of ${node .id }' ] = [
169- node .builderOptionsId,
170- expectedNode .builderOptionsId,
205+ nodeConfiguration .builderOptionsId,
206+ expectedNodeConfiguration .builderOptionsId,
171207 ];
172208 matches = false ;
173209 }
210+ final nodeState = node.postProcessAnchorNodeState;
211+ final expectedNodeState = expectedNode.postProcessAnchorNodeState;
174212 if (checkPreviousInputsDigest &&
175- node.previousInputsDigest != expectedNode.previousInputsDigest) {
213+ nodeState.previousInputsDigest !=
214+ expectedNodeState.previousInputsDigest) {
176215 matchState['previousInputsDigest of ${node .id }' ] = [
177- node .previousInputsDigest,
178- expectedNode .previousInputsDigest,
216+ nodeState .previousInputsDigest,
217+ expectedNodeState .previousInputsDigest,
179218 ];
180219 matches = false ;
181220 }
182- if (node.primaryInput != expectedNode.primaryInput) {
221+ if (nodeConfiguration.primaryInput !=
222+ expectedNodeConfiguration.primaryInput) {
183223 matchState['primaryInput of ${node .id }' ] = [
184- node .primaryInput,
185- expectedNode .primaryInput,
224+ nodeConfiguration .primaryInput,
225+ expectedNodeConfiguration .primaryInput,
186226 ];
187227 matches = false ;
188228 }
0 commit comments