@@ -19,12 +19,14 @@ MTMethodMutationTest >> testAccessing [
19
19
operator := MTReplacePlusWithMinusMutantOperator new .
20
20
modifiedSource := operator
21
21
modifiedSourceFor: compiledMethod
22
- number: 1 .
22
+ number: 1
23
+ newExpression: operator newExpression.
23
24
methodMutation := MTMethodMutation
24
25
for: compiledMethod
25
26
using: operator
26
27
nodeNumber: 1
27
- ofClass: MTAuxiliarClassForMTAnalysis .
28
+ ofClass: MTAuxiliarClassForMTAnalysis
29
+ replacingWith: operator newExpression.
28
30
self
29
31
assert: methodMutation originalSource
30
32
equals: compiledMethod sourceCode asString.
@@ -43,12 +45,14 @@ MTMethodMutationTest >> testAccessingToNodes [
43
45
operator := MTReplacePlusWithMinusMutantOperator new .
44
46
modifiedSource := operator
45
47
modifiedSourceFor: compiledMethod
46
- number: 1 .
48
+ number: 1
49
+ newExpression: operator newExpression.
47
50
methodMutation := MTMethodMutation
48
51
for: compiledMethod
49
52
using: operator
50
53
nodeNumber: 1
51
- ofClass: MTAuxiliarClassForMTAnalysis .
54
+ ofClass: MTAuxiliarClassForMTAnalysis
55
+ replacingWith: operator newExpression.
52
56
self
53
57
assert: methodMutation nodeToMutate formattedCode
54
58
equals: ' 1 + 2' .
@@ -69,22 +73,23 @@ MTMethodMutationTest >> testMutatedNodeBugFix [
69
73
MTMethodMutationTest >> testMutationInfiniteLoop [
70
74
71
75
| compiledMethod operator modifiedSource methodMutation res |
72
-
73
76
" This test will execute another test that will time out.
74
77
So this test will need a higher time limit"
75
78
self timeLimit: self defaultTimeLimit * 2 .
76
-
79
+
77
80
compiledMethod := MTFakeInfiniteLoopForTest >> #iterativeFactorial: .
78
81
operator := MTReplaceLessOrEqualWithTrueOperator new .
79
-
82
+
80
83
modifiedSource := operator
81
84
modifiedSourceFor: compiledMethod
82
- number: 1 .
85
+ number: 1
86
+ newExpression: operator newExpression.
83
87
methodMutation := MTMethodMutation
84
88
for: compiledMethod
85
89
using: operator
86
90
nodeNumber: 1
87
- ofClass: MTFakeInfiniteLoopForTest .
91
+ ofClass: MTFakeInfiniteLoopForTest
92
+ replacingWith: operator newExpression.
88
93
89
94
methodMutation testCaseReferences: { (MTTestCaseReference
90
95
for: #testIterativeFactorial
@@ -99,22 +104,23 @@ MTMethodMutationTest >> testMutationInfiniteLoop [
99
104
MTMethodMutationTest >> testMutationInfiniteRecursion [
100
105
101
106
| compiledMethod operator modifiedSource methodMutation res |
102
-
103
107
" This test will execute another test that will time out.
104
108
So this test will need a higher time limit"
105
109
self timeLimit: self defaultTimeLimit * 2 .
106
-
110
+
107
111
compiledMethod := MTFakeInfiniteLoopForTest >> #recursiveFactorial: .
108
112
operator := MTReplaceIfTrueReceiverWithFalseOperator new .
109
-
113
+
110
114
modifiedSource := operator
111
115
modifiedSourceFor: compiledMethod
112
- number: 1 .
116
+ number: 1
117
+ newExpression: operator newExpression.
113
118
methodMutation := MTMethodMutation
114
119
for: compiledMethod
115
120
using: operator
116
121
nodeNumber: 1
117
- ofClass: MTFakeInfiniteLoopForTest .
122
+ ofClass: MTFakeInfiniteLoopForTest
123
+ replacingWith: operator newExpression.
118
124
119
125
methodMutation testCaseReferences: { (MTTestCaseReference
120
126
for: #testRecursiveFactorial
@@ -134,12 +140,14 @@ MTMethodMutationTest >> testMutationRun [
134
140
operator := MTReplacePlusWithMinusMutantOperator new .
135
141
modifiedSource := operator
136
142
modifiedSourceFor: compiledMethod
137
- number: 1 .
143
+ number: 1
144
+ newExpression: operator newExpression.
138
145
methodMutation := MTMethodMutation
139
146
for: compiledMethod
140
147
using: operator
141
148
nodeNumber: 1
142
- ofClass: MTAuxiliarClassForMTAnalysis .
149
+ ofClass: MTAuxiliarClassForMTAnalysis
150
+ replacingWith: operator newExpression.
143
151
methodMutation testCaseReferences:
144
152
{ (MTTestCaseReference for: #simpleTestCaseRessource in: self class ) }.
145
153
res := methodMutation runMutantStoppingOnError: true .
0 commit comments