mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Also use Console.write() to print the assertion message because it uses write(2) without buffering. Swift SVN r5943
14 lines
312 B
Swift
14 lines
312 B
Swift
// RUN: %swift -i %s 2>&1 | FileCheck %s
|
|
|
|
func test_alwaysTrap() {
|
|
var x = 2
|
|
alwaysTrap(x * 21 == 42, "should not fail")
|
|
con.write("OK")
|
|
// CHECK: OK
|
|
alwaysTrap(x == 42, "this should fail")
|
|
// CHECK: assertion failed: this should fail: file {{.*}}Assert.swift, line [[@LINE-1]]
|
|
}
|
|
|
|
test_alwaysTrap()
|
|
|