@@ -8,20 +8,37 @@ import AmbiguousMethods
88
99var CxxAmbiguousMethodTestSuite = TestSuite ( " CxxAmbiguousMethods " )
1010
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+
1130CxxAmbiguousMethodTestSuite . test ( " numberOfMutableMethodsCalled: () -> Int " ) {
1231 var instance = HasAmbiguousMethods ( )
1332
1433 // Sanity check. Make sure we start at 0
34+ // and that calling numberOfMutableMethodsCalled doesn't change
35+ // the count
1536 expectEqual ( 0 , instance. numberOfMutableMethodsCalled ( ) )
16-
17- // Make sure calling numberOfMutableMethodsCalled above didn't
18- // change the count
1937 expectEqual ( 0 , instance. numberOfMutableMethodsCalled ( ) )
2038
2139 // Check that mutable version _does_ change the mutable call count
40+ expectEqual ( 0 , instance. numberOfMutableMethodsCalled ( ) )
2241 expectEqual ( 1 , instance. numberOfMutableMethodsCalledMutating ( ) )
23-
24- expectEqual ( 1 , instance. numberOfMutableMethodsCalled ( ) )
2542}
2643
2744CxxAmbiguousMethodTestSuite . test ( " Basic Increment: (Int) -> Int " ) {
0 commit comments