22AccuracyTest uses AccuracyTestExample
33"
44Class {
5- #name : # PMAccuracyTest ,
6- #superclass : # TestCase ,
5+ #name : ' PMAccuracyTest' ,
6+ #superclass : ' TestCase' ,
77 #instVars : [
88 ' a' ,
99 ' dp'
1010 ],
11- #category : #' Math-Tests-Accuracy'
11+ #category : ' Math-Tests-Accuracy' ,
12+ #package : ' Math-Tests-Accuracy'
1213}
1314
14- { #category : # initialization }
15+ { #category : ' initialization' }
1516PMAccuracyTest >> initialize [
1617 super initialize.
1718 dp := PMAccuracyTestExample decimalPlaces
1819]
1920
20- { #category : # running }
21+ { #category : ' running' }
2122PMAccuracyTest >> setUp [
2223 super setUp.
2324 a := PMAccuracyTestExample new .
2425 PMAccuracyTestExample decimalPlaces: 3
2526]
2627
27- { #category : # running }
28+ { #category : ' running' }
2829PMAccuracyTest >> tearDown [
2930 PMAccuracyTestExample decimalPlaces: dp.
3031 super tearDown
3132]
3233
33- { #category : # tests }
34+ { #category : ' tests' }
3435PMAccuracyTest >> testArgumentAt [
3536 self assert: (a argumentAt: ' Aaa' ) equals: #(#(false) #(true) ).
3637 self assert: (a argumentAt: ' Bbb' ) equals: #(#('a') #('AG') ).
3738 self assert: (a argumentAt: ' Ddd' ) isNil.
3839 self assert: (a argumentAt: ' Ccc' ) equals: #(#(1) #(1.1) #(0.9) )
3940]
4041
41- { #category : # tests }
42+ { #category : ' tests' }
4243PMAccuracyTest >> testAsArray [
4344 self assert: (a asArray: ' bla' ) equals: #('bla') .
4445 self assert: (a asArray: #('bla') ) equals: #('bla') .
@@ -47,7 +48,7 @@ PMAccuracyTest >> testAsArray [
4748 equals: #('bla')
4849]
4950
50- { #category : # tests }
51+ { #category : ' tests' }
5152PMAccuracyTest >> testCalcDeviationsInMax [
5253 | r c |
5354 c := #(#(1 2 3) #(2 3 6) ).
@@ -60,7 +61,7 @@ PMAccuracyTest >> testCalcDeviationsInMax [
6061 equals: (Array with: (100 / 3 ) asFloat with: (100 / 3 ) asFloat with: 50 )
6162]
6263
63- { #category : # tests }
64+ { #category : ' tests' }
6465PMAccuracyTest >> testCalcErrorOfRealResult [
6566 self assert: (a calcErrorOf: 0.7 realResult: 0.7 ) equals: 0 .
6667 self assert: (a calcErrorOf: 0.7 realResult: 0.0 ) equals: - 100 .
@@ -74,14 +75,14 @@ PMAccuracyTest >> testCalcErrorOfRealResult [
7475 equals: Float infinity negated
7576]
7677
77- { #category : # tests }
78+ { #category : ' tests' }
7879PMAccuracyTest >> testDecimalPlaces [
7980 self assert: a class decimalPlaces equals: 3 .
8081 a class decimalPlaces: 2 .
8182 self assert: a class decimalPlaces equals: 2
8283]
8384
84- { #category : # tests }
85+ { #category : ' tests' }
8586PMAccuracyTest >> testExtractFromResultsReturnsAllElementsWhenOnlyOneIsTrue [
8687 | argument results |
8788 results := a
@@ -94,7 +95,7 @@ PMAccuracyTest >> testExtractFromResultsReturnsAllElementsWhenOnlyOneIsTrue [
9495 self assert: argument equals: #(#(false) #(true) )
9596]
9697
97- { #category : # tests }
98+ { #category : ' tests' }
9899PMAccuracyTest >> testExtractFromResultsReturnsTheCorrectIndexedElementWhenOnlyOneIsFalse [
99100 | argument results |
100101 results := a
@@ -107,7 +108,7 @@ PMAccuracyTest >> testExtractFromResultsReturnsTheCorrectIndexedElementWhenOnlyO
107108 self assert: argument equals: #(true)
108109]
109110
110- { #category : # tests }
111+ { #category : ' tests' }
111112PMAccuracyTest >> testExtremeCollectionmax [
112113 | c |
113114 c := #(4 4 2) .
@@ -122,7 +123,7 @@ PMAccuracyTest >> testExtremeCollectionmax [
122123 equals: (Array with: Float infinity with: Float infinity with: Float infinity)
123124]
124125
125- { #category : # tests }
126+ { #category : ' tests' }
126127PMAccuracyTest >> testFormat [
127128 self
128129 assert: (a format: #(1 'rez' 1.8899) )
@@ -134,7 +135,7 @@ PMAccuracyTest >> testFormat [
134135 self assert: (a format: 0 - Float infinity) equals: #('-Infinity')
135136]
136137
137- { #category : # tests }
138+ { #category : ' tests' }
138139PMAccuracyTest >> testFormatTypePostfix [
139140 | r |
140141 r := a format: #(1 'rez' 1.8899) type: ' x' postfix: ' %%' .
@@ -145,7 +146,7 @@ PMAccuracyTest >> testFormatTypePostfix [
145146 equals: ' x: 1.0%% , rez%% , 1.89%% : 1.89 , true '
146147]
147148
148- { #category : # tests }
149+ { #category : ' tests' }
149150PMAccuracyTest >> testFormatTypePostfixTree [
150151 | t |
151152 t := KeyedTree new .
@@ -165,7 +166,7 @@ PMAccuracyTest >> testFormatTypePostfixTree [
165166 yourself )
166167]
167168
168- { #category : # tests }
169+ { #category : ' tests' }
169170PMAccuracyTest >> testGetters [
170171
171172 | r |
@@ -175,15 +176,15 @@ PMAccuracyTest >> testGetters [
175176 self assert: r equals: #( #( #( 1 ) #( 3 ) ) #( #( 'a' ) #( 'AG' ) ) #( #( 2 ) #( 3 ) ) 2 2 )
176177]
177178
178- { #category : # tests }
179+ { #category : ' tests' }
179180PMAccuracyTest >> testIfSeveralterations [
180181 a iterations: 2 .
181182 self assert: (a ifSeveralterations: [ 1 ]) equals: 1 .
182183 a iterations: 1 .
183184 self assert: (a ifSeveralterations: [ 1 ]) equals: a
184185]
185186
186- { #category : # tests }
187+ { #category : ' tests' }
187188PMAccuracyTest >> testIterations [
188189
189190 | s d |
@@ -199,18 +200,18 @@ PMAccuracyTest >> testIterations [
199200 self assert: (d atPath: #( 'Ddd' 'data' ) ) equals: #( #( 2 3 ) #( 2 3 ) ).
200201 s := d atPath: #( 'Ddd' 'error' ) .
201202 self assert: s first closeTo: - 45 .
202- self assert: s second closeTo: - 26.6666667
203+ self assert: s second closeTo: - 26.6666667 precision: 0.00001
203204]
204205
205- { #category : # tests }
206+ { #category : ' tests' }
206207PMAccuracyTest >> testNumberOfDifferentParametersAt [
207208 self assert: (a numberOfDifferentParametersAt: ' Aaa' ) equals: 2 .
208209 self assert: (a numberOfDifferentParametersAt: ' Ccc' ) equals: 2 .
209210 self assert: (a numberOfDifferentParametersAt: ' Ddd' ) equals: 1 .
210211 self assert: (a numberOfDifferentParametersAt: ' Fff' ) equals: 1
211212]
212213
213- { #category : # tests }
214+ { #category : ' tests' }
214215PMAccuracyTest >> testNumberOfDifferentResultsAt [
215216 self assert: (a numberOfDifferentResultsAt: ' Aaa' ) equals: 2 .
216217 self assert: (a numberOfDifferentResultsAt: ' Bbb' ) equals: 2 .
@@ -219,15 +220,15 @@ PMAccuracyTest >> testNumberOfDifferentResultsAt [
219220 self assert: (a numberOfDifferentResultsAt: ' Eee' ) equals: 2
220221]
221222
222- { #category : # tests }
223+ { #category : ' tests' }
223224PMAccuracyTest >> testParameterAt [
224225 self assert: (a parameterAt: ' Aaa' ) equals: #(#(1 2) #(3 2.8888) ).
225226 self assert: (a parameterAt: ' Bbb' ) equals: #(#(1) #(3) ).
226227 self assert: (a parameterAt: ' Ddd' ) isNil.
227228 self assert: (a parameterAt: ' Fff' ) isNil
228229]
229230
230- { #category : # tests }
231+ { #category : ' tests' }
231232PMAccuracyTest >> testPrintOn [
232233 | s |
233234 s := WriteStream on: String new .
@@ -244,14 +245,14 @@ PMAccuracyTest >> testPrintOn [
244245Report for: PMAccuracyTestExample' )
245246]
246247
247- { #category : # tests }
248+ { #category : ' tests' }
248249PMAccuracyTest >> testReport [
249250 self assert: a report equals: ' ' .
250251 a run.
251252 self assert: (a report beginsWith: ' Report for: PMAccuracyTestExample' )
252253]
253254
254- { #category : # tests }
255+ { #category : ' tests' }
255256PMAccuracyTest >> testResultsKeyForAtPosition [
256257 self assert: (a resultsKeyFor: ' Aaa' AtPosition: 2 ) equals: #(4 4) .
257258 self assert: (a resultsKeyFor: ' Bbb' AtPosition: 1 ) equals: #(2) .
@@ -284,7 +285,7 @@ PMAccuracyTest >> testResultsKeyForAtPosition [
284285 equals: #(0 1 0 -2 3)
285286]
286287
287- { #category : # tests }
288+ { #category : ' tests' }
288289PMAccuracyTest >> testRun [
289290 a run.
290291 a run: ' Bbb' .
@@ -301,7 +302,7 @@ test Bbb').
301302 equals: #('Ccc' 'Eee')
302303]
303304
304- { #category : # tests }
305+ { #category : ' tests' }
305306PMAccuracyTest >> testSetUp [
306307 self assert: a count equals: 0 .
307308 a performCheck: ' Fff' .
@@ -311,7 +312,7 @@ PMAccuracyTest >> testSetUp [
311312 self assert: a count equals: 16 / 5
312313]
313314
314- { #category : # tests }
315+ { #category : ' tests' }
315316PMAccuracyTest >> testTreeTypeData [
316317 | aTree |
317318 aTree := KeyedTree new .
@@ -325,7 +326,7 @@ PMAccuracyTest >> testTreeTypeData [
325326 yourself )
326327]
327328
328- { #category : # tests }
329+ { #category : ' tests' }
329330PMAccuracyTest >> testperformCheck [
330331 | b |
331332 a extractFromResults: ' bla' which: 2 onlyOne: false . " for setting numberOfResults"
0 commit comments