forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_class_add_property.swift
41 lines (32 loc) · 1.03 KB
/
test_class_add_property.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %target-resilience-test
// REQUIRES: executable_test
import StdlibUnittest
import class_add_property
var ClassAddPropertyTest = TestSuite("ClassAddProperty")
ClassAddPropertyTest.test("AddStoredProperty") {
let t1 = AddStoredProperty()
let t2 = AddStoredProperty()
do {
expectEqual(t1.forth, "Chuck Moore")
expectEqual(t2.forth, "Chuck Moore")
}
do {
t1.forth = "Elizabeth Rather"
expectEqual(t1.forth, "Elizabeth Rather")
expectEqual(t2.forth, "Chuck Moore")
}
do {
if getVersion() > 0 {
expectEqual(t1.languageDesigners, ["Elizabeth Rather",
"John McCarthy",
"Dennis Ritchie"])
expectEqual(t2.languageDesigners, ["Chuck Moore",
"John McCarthy",
"Dennis Ritchie"])
} else {
expectEqual(t1.languageDesigners, ["Elizabeth Rather"])
expectEqual(t2.languageDesigners, ["Chuck Moore"])
}
}
}
runAllTests()