Skip to content

Commit c2fadc3

Browse files
committed
[unittest] Fix some unintentional behaviour in EditingTest
I haven't found any cases where this changes the visible behaviour of the test, but having the file remain open across invocations was certainly unexpected and affects how the first part of the test works at runtime.
1 parent 7912da4 commit c2fadc3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

unittests/SourceKit/SwiftLang/EditingTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void EditTest::doubleOpenWithDelay(useconds_t delay, bool closeDoc) {
253253
// be queried, since the semantic info from the first open is unreachable.
254254
for (int i = 0; i < 2; ++i) {
255255
bool expired = waitForDocUpdate(/*reset=*/true);
256-
ASSERT_FALSE(expired) << "no second notification";
256+
ASSERT_FALSE(expired) << "no " << (i ? "second " : "") << "notification";
257257
replaceText(DocName, 0, 0, StringRef(), Consumer);
258258
if (!Consumer.Diags.empty())
259259
break;
@@ -262,6 +262,8 @@ void EditTest::doubleOpenWithDelay(useconds_t delay, bool closeDoc) {
262262

263263
ASSERT_EQ(1u, Consumer.Diags.size());
264264
EXPECT_STREQ("use of unresolved identifier 'unknown_name'", Consumer.Diags[0].Description.c_str());
265+
266+
close(DocName);
265267
}
266268

267269
// This test is failing occassionally in CI: rdar://42483323

0 commit comments

Comments
 (0)