|
| 1 | +Class { |
| 2 | + #name : 'MTPragmaRejectionTestFilterTest', |
| 3 | + #superclass : 'MTTestFilterTest', |
| 4 | + #category : 'MuTalk-Tests', |
| 5 | + #package : 'MuTalk-Tests' |
| 6 | +} |
| 7 | + |
| 8 | +{ #category : 'running' } |
| 9 | +MTPragmaRejectionTestFilterTest >> runAnalysisForPragmaCondition: aPragmaSelector [ |
| 10 | + |
| 11 | + self |
| 12 | + runAnalysisWithFilter: |
| 13 | + (MTPragmaRejectionTestFilter for: aPragmaSelector) |
| 14 | + on: { MTAuxiliarClassForTestFilter } |
| 15 | + withTests: { MTAuxiliarTestClassForPragmaTestFilter } |
| 16 | +] |
| 17 | + |
| 18 | +{ #category : 'running' } |
| 19 | +MTPragmaRejectionTestFilterTest >> runAnalysisForPragmaCondition: aPragmaSelector andArguments: pragmaArguments [ |
| 20 | + |
| 21 | + self |
| 22 | + runAnalysisWithFilter: (MTPragmaRejectionTestFilter |
| 23 | + for: aPragmaSelector |
| 24 | + arguments: pragmaArguments) |
| 25 | + on: { MTAuxiliarClassForTestFilter } |
| 26 | + withTests: { MTAuxiliarTestClassForPragmaTestFilter } |
| 27 | +] |
| 28 | + |
| 29 | +{ #category : 'tests' } |
| 30 | +MTPragmaRejectionTestFilterTest >> testTestWithPragmaIsExcluded [ |
| 31 | + |
| 32 | + | result | |
| 33 | + self runAnalysisForPragmaCondition: #aPragma. |
| 34 | + result := analysis generalResult particularResults at: 1. |
| 35 | + |
| 36 | + self assert: result runCount equals: 1. |
| 37 | + self |
| 38 | + assert: (result mutantResults at: 1) selector |
| 39 | + equals: #testWithoutPragma |
| 40 | +] |
| 41 | + |
| 42 | +{ #category : 'tests' } |
| 43 | +MTPragmaRejectionTestFilterTest >> testTestWithPragmaIsNotExcluded [ |
| 44 | + |
| 45 | + self runAnalysisForPragmaCondition: #anotherPragma. |
| 46 | + |
| 47 | + self |
| 48 | + assert: (analysis generalResult particularResults at: 1) runCount |
| 49 | + equals: 2 |
| 50 | +] |
| 51 | + |
| 52 | +{ #category : 'tests' } |
| 53 | +MTPragmaRejectionTestFilterTest >> testTestWithPragmaIsNotExcluded2 [ |
| 54 | + |
| 55 | + self runAnalysisForPragmaCondition: #aPragma: andArguments: 'arg'. |
| 56 | + |
| 57 | + self |
| 58 | + assert: (analysis generalResult particularResults at: 1) runCount |
| 59 | + equals: 2 |
| 60 | +] |
0 commit comments