@@ -8,20 +8,37 @@ import AmbiguousMethods
8
8
9
9
var CxxAmbiguousMethodTestSuite = TestSuite ( " CxxAmbiguousMethods " )
10
10
11
+ // It's important to check that both calling the const version first
12
+ // and the mutable version first pass. This helps confirm that the lookup
13
+ // table is being properly seeded.
14
+ CxxAmbiguousMethodTestSuite . test ( " ping const first " ) {
15
+ var instance = HasAmbiguousMethods ( )
16
+
17
+ instance. ping ( )
18
+ instance. pingMutable ( )
19
+ expectEqual ( 1 , instance. numberOfMutableMethodsCalled ( ) )
20
+ }
21
+
22
+ CxxAmbiguousMethodTestSuite . test ( " ping mutable first " ) {
23
+ var instance = HasAmbiguousMethods ( )
24
+
25
+ instance. pingMutable ( )
26
+ instance. ping ( )
27
+ expectEqual ( 1 , instance. numberOfMutableMethodsCalled ( ) )
28
+ }
29
+
11
30
CxxAmbiguousMethodTestSuite . test ( " numberOfMutableMethodsCalled: () -> Int " ) {
12
31
var instance = HasAmbiguousMethods ( )
13
32
14
33
// Sanity check. Make sure we start at 0
34
+ // and that calling numberOfMutableMethodsCalled doesn't change
35
+ // the count
15
36
expectEqual ( 0 , instance. numberOfMutableMethodsCalled ( ) )
16
-
17
- // Make sure calling numberOfMutableMethodsCalled above didn't
18
- // change the count
19
37
expectEqual ( 0 , instance. numberOfMutableMethodsCalled ( ) )
20
38
21
39
// Check that mutable version _does_ change the mutable call count
40
+ expectEqual ( 0 , instance. numberOfMutableMethodsCalled ( ) )
22
41
expectEqual ( 1 , instance. numberOfMutableMethodsCalledMutating ( ) )
23
-
24
- expectEqual ( 1 , instance. numberOfMutableMethodsCalled ( ) )
25
42
}
26
43
27
44
CxxAmbiguousMethodTestSuite . test ( " Basic Increment: (Int) -> Int " ) {
0 commit comments