RegressionTests__IntervalAndGeometricSeriesTests.st
author Claus Gittinger <cg@exept.de>
Tue, 25 Feb 2020 17:19:46 +0100
changeset 2585 f93664a7393a
parent 2369 6df45ae0a5ef
permissions -rw-r--r--
s
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2368
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
     1
"{ Encoding: utf8 }"
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
     2
2367
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:goodies/regression' }"
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
"{ NameSpace: RegressionTests }"
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
TestCase subclass:#IntervalAndGeometricSeriesTests
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	instanceVariableNames:''
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	classVariableNames:''
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	poolDictionaries:''
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	category:'tests-Regression-Collections'
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
2368
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    15
!IntervalAndGeometricSeriesTests class methodsFor:'queries'!
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    16
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    17
coveredClassNames
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    18
    "These classes will be instrumented for coverage analysis,
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    19
     before running the suite to provide coverage analysis/report"
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    20
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    21
    ^ #(GeometricSeries)
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    22
! !
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    23
2367
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!IntervalAndGeometricSeriesTests methodsFor:'tests'!
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
2369
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    26
test10_geometricSeries
2367
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
     {
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
        (1 to:100 byFactor:2)       .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
        (1 to:100 byFactor:3)       .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
        (10 to:100 byFactor:3)      .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
        (100 to:10 byFactor:1/3)    .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
        (100 to:1 byFactor:1/2)     .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
        (1 to:100 byFactor:2.0)     .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
        (1 to:64.0 byFactor:2.0)    .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
        (1 to:100 byFactor:3.0)     .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
        (10 to:100.0 byFactor:3)    .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
        (100 to:10.0 byFactor:0.3)  .  
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
        (100 to:3 byFactor:1/2)     .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
        (100 to:3 byFactor:0.5)     .
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    } do:[:each |
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
        |eachEnumeratedAsArray|
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
        eachEnumeratedAsArray := Array streamContents:[:s | each do:[:el | s nextPut:el]].
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        self assert:eachEnumeratedAsArray = each asArray.
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
        self assert:eachEnumeratedAsArray size = each size.
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        self assert:eachEnumeratedAsArray last = each last.
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        self assert:eachEnumeratedAsArray first = each first.
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    ]
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    "
2369
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    52
     self run:#test10_geometricSeries
2367
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    "
2368
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    54
!
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    55
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    56
test11_geometricSeries
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    57
    self assert:((1 to:100 byFactor:2) sameContentsAs: (1 to:100 byFactor:2) asArray).
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    58
    self assert:((1 to:100 byFactor:2) sameContentsAs: (1 to:99 byFactor:2)).
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    59
    self assert:((1 to:100 byFactor:2) = (1 to:100 byFactor:2) asArray) not.
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    60
2369
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    61
    self assert:(1 to:100 byFactor:2) last = 64.
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    62
    self assert:(1 to:64 byFactor:2) last = 64.
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    63
    self assert:(64 to:1 byFactor:1/2) last = 1.
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    64
2368
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    65
    "
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    66
     self run:#test11_geometricSeries
9991b612155a #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2367
diff changeset
    67
    "
2369
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    68
!
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    69
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    70
test12_geometricSeries
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    71
    self assert:(1 to:100 byFactor:2) printString = '1 to:100 byFactor:2'.
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    72
    self assert:(1 to:100 byFactor:2) storeString = '(1 to:100 byFactor:2)'.
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    73
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    74
    "
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    75
     self run:#test12_geometricSeries
6df45ae0a5ef #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
    76
    "
2367
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
! !
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
!IntervalAndGeometricSeriesTests class methodsFor:'documentation'!
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
version_CVS
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    ^ '$Header$'
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
! !
2251be113cdb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84