Skip to content

Commit 181061b

Browse files
Fix test case for use-after-free diagnostic message
The line number in the diagnostic message was hardcoded but it was changed in the previous commit.
1 parent 359b2a9 commit 181061b

File tree

1 file changed

+2
-1
lines changed
  • IntegrationTests/TestSuites/Sources/PrimaryTests

1 file changed

+2
-1
lines changed

Diff for: IntegrationTests/TestSuites/Sources/PrimaryTests/main.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,11 @@ try test("Closure Lifetime") {
260260
#if JAVASCRIPTKIT_WITHOUT_WEAKREFS
261261
// Check diagnostics of use-after-free
262262
do {
263+
let c1Line = #line + 1
263264
let c1 = JSClosure { $0[0] }
264265
c1.release()
265266
let error = try expectThrow(try evalClosure.throws(c1, JSValue.number(42.0))) as! JSValue
266-
try expect("Error message should contains definition location", error.description.hasSuffix("PrimaryTests/main.swift:247"))
267+
try expect("Error message should contains definition location", error.description.hasSuffix("PrimaryTests/main.swift:\(c1Line)"))
267268
}
268269
#endif
269270

0 commit comments

Comments
 (0)