Skip to content

Commit

Permalink
add test for non round percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
Durieux Pol committed Dec 14, 2023
1 parent af6ffb1 commit a2369c3
Showing 1 changed file with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,42 @@ MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateAllMutantsWithMoreTh
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateTheCorrectPercentageOfMutants [
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithNegativePercentConstraint [

self runAnalysisFor: 20.
self runAnalysisFor: -10.
self
assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100
equals: 20
equals: 0
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithNegativePercentConstraint [
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithZeroPercentConstraint [

self runAnalysisFor: -10.
self runAnalysisFor: 0.
self
assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100
equals: 0
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithZeroPercentConstraint [
MutationTestingPercentageOfMutantsBudgetTest >> testNonExactPercentageOfMutants [

self runAnalysisFor: 0.
self runAnalysisFor: 21.
self assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100 >= 21.
self
assert: analysis generalResult numberOfEvaluatedMutants
equals: 6
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testRoundPercentageOfMutants [

self runAnalysisFor: 20.
self
assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100
equals: 0
equals: 20
]

0 comments on commit a2369c3

Please sign in to comment.