Skip to content

Commit 61f5e88

Browse files
jensjohacommit-bot@chromium.org
authored andcommitted
[CFE] [Strong test] Check non-serialized expectations first
This gives a "MismatchExpectations" error instead of "MismatchExpectationsSerialized" if the serialization doesn't matter in getting to the mismatch. The serialized version is skipped when updating expectations to not makeing the serialized version the "right" verison (which could get you into a position where updating expectations and rerunning would tell you the (normal) expectations needed updating). Change-Id: I99b3af5fa823010d4abbf0837faf00e17b303c0c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126540 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
1 parent 3e5ae6a commit 61f5e88

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

pkg/front_end/test/fasta/testing/suite.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,14 @@ class FastaContext extends ChainContext with MatchContext {
199199
new Verify(fullCompile)
200200
] {
201201
if (!ignoreExpectations) {
202-
steps.add(new MatchExpectation(
203-
fullCompile ? ".strong.expect" : ".outline.expect",
204-
serializeFirst: true));
205202
steps.add(new MatchExpectation(
206203
fullCompile ? ".strong.expect" : ".outline.expect",
207204
serializeFirst: false));
205+
if (!updateExpectations) {
206+
steps.add(new MatchExpectation(
207+
fullCompile ? ".strong.expect" : ".outline.expect",
208+
serializeFirst: true));
209+
}
208210
}
209211
steps.add(const TypeCheck());
210212
steps.add(const EnsureNoErrors());
@@ -214,16 +216,18 @@ class FastaContext extends ChainContext with MatchContext {
214216
if (fullCompile) {
215217
steps.add(const Transform());
216218
if (!ignoreExpectations) {
217-
steps.add(new MatchExpectation(
218-
fullCompile
219-
? ".strong.transformed.expect"
220-
: ".outline.transformed.expect",
221-
serializeFirst: true));
222219
steps.add(new MatchExpectation(
223220
fullCompile
224221
? ".strong.transformed.expect"
225222
: ".outline.transformed.expect",
226223
serializeFirst: false));
224+
if (!updateExpectations) {
225+
steps.add(new MatchExpectation(
226+
fullCompile
227+
? ".strong.transformed.expect"
228+
: ".outline.transformed.expect",
229+
serializeFirst: true));
230+
}
227231
}
228232
steps.add(const EnsureNoErrors());
229233
if (!skipVm) {

0 commit comments

Comments
 (0)