RegressionTests__KoelnerPhoneticCodeStringComparatorTest.st
author Claus Gittinger <cg@exept.de>
Tue, 28 Feb 2017 16:42:12 +0100
changeset 1596 77e41a57cda0
parent 1447 2351db93aa5b
child 1500 d406a10b2965
child 1654 9091b358d049
permissions -rw-r--r--
#DOCUMENTATION by cg class: RegressionTests::SmallIntegerTest changed: #testNegation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
     1
"{ Package: 'stx:goodies/regression' }"
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
540
cbe585857328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
     3
"{ NameSpace: RegressionTests }"
cbe585857328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
     4
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
TestCase subclass:#KoelnerPhoneticCodeStringComparatorTest
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:'sc'
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
1413
c9ef56f181ff #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
     9
	category:'tests-Regression-Collections-Utilities'
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!KoelnerPhoneticCodeStringComparatorTest methodsFor:'running'!
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
setUp
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
    sc := PhoneticStringUtilities::KoelnerPhoneticCodeStringComparator new
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
! !
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!KoelnerPhoneticCodeStringComparatorTest methodsFor:'tests'!
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
testSomeCombinations
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
    |code s|
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    24
    "/ compares all 4-char combinations against
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
    $A to:$Z do:[:c1 |
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    26
	$A to:$Z do:[:c2 |
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    27
	    $A to:$Z do:[:c3 |
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    28
		$A to:$Z do:[:c4 |
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    29
		    s := String with:c1 with:c2 with:c3 with:c4.
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    30
		    code := (sc phoneticStringsFor:s) first.
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    31
		    self assert:( code = s asKoelnerPhoneticCode).
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    32
		].
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    33
	    ].
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    34
	].
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
    ].
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
testWellKnownResults
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    |code koeln|
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    koeln := [:w | (sc phoneticStringsFor:w) first].
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    code := (sc phoneticStringsFor:'Miller') first.
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    self assert:( code = 'Miller' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    #( 'Acton' 'Ashdown' 'Ashton' 'Astin' 'Aston' 'Austen' 'Austin' 'Austine' 'Axten')
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    do:[:w |
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    48
	code := koeln value:(w).
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    49
	self assert:( code = (w asKoelnerPhoneticCode)).
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    ].
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    #( 'Reader' 'Reeder' 'Rider' 'Ritter' 'Rothera' 'Rothra' 'Ruder' 'Rutter' 'Ryder')
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    do:[:w |
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    54
	code := koeln value:(w).
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    55
	self assert:( code = (w asKoelnerPhoneticCode)).
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    ].
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    #( 'Wace' 'Waugh' 'Wookey')
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    do:[:w |
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    60
	code := koeln value:(w).
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    61
	self assert:( code = (w asKoelnerPhoneticCode)).
532
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ].
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    code := koeln value:('Abbot').
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    self assert:( code = 'Abbot' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    code := koeln value:('Abbots').
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    self assert:( code = 'Abbots' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    code := koeln value:('Ashcroft').
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    self assert:( code = 'Ashcroft' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    code := koeln value:('Lloyd').
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    self assert:( code = 'Lloyd' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    code := koeln value:('Pfister').
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    self assert:( code = 'Pfister' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    self assert: ( koeln value:( 'A' )) = ('A' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    self assert: ( koeln value:( 'B' )) = ('B' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    self assert: ( koeln value:( 'C' )) = ('C' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    self assert: ( koeln value:( 'D' )) = ('D' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    self assert: ( koeln value:( 'E' )) = ('E' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    self assert: ( koeln value:( 'F' )) = ('F' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    self assert: ( koeln value:( 'G' )) = ('G' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    self assert: ( koeln value:( 'H' )) = ('H' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    self assert: ( koeln value:( 'I' )) = ('I' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    self assert: ( koeln value:( 'J' )) = ('J' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    self assert: ( koeln value:( 'K' )) = ('K' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    self assert: ( koeln value:( 'L' )) = ('L' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    self assert: ( koeln value:( 'M' )) = ('M' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    self assert: ( koeln value:( 'N' )) = ('N' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    self assert: ( koeln value:( 'O' )) = ('O' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    self assert: ( koeln value:( 'P' )) = ('P' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    self assert: ( koeln value:( 'Q' )) = ('Q' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    self assert: ( koeln value:( 'R' )) = ('R' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    self assert: ( koeln value:( 'S' )) = ('S' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    self assert: ( koeln value:( 'T' )) = ('T' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    self assert: ( koeln value:( 'U' )) = ('U' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    self assert: ( koeln value:( 'V' )) = ('V' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    self assert: ( koeln value:( 'W' )) = ('W' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    self assert: ( koeln value:( 'X' )) = ('X' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    self assert: ( koeln value:( 'Y' )) = ('Y' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    self assert: ( koeln value:( 'Z' )) = ('Z' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    self assert: ( koeln value:( 'AEHIOW' )) = ('AEHIOW' asKoelnerPhoneticCode) .
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    self assert: ( koeln value:( 'BPFV' )) = ('BPFV' asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    self assert: ( koeln value:( 'CGJKQSXZ' )) = ('CGJKQSXZ'  asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    self assert: ( koeln value:( 'DT' )) = ('DT'  asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    self assert: ( koeln value:( 'L' )) = ('L'  asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    self assert: ( koeln value:( 'MN' )) = ('MN'  asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    self assert: ( koeln value:( 'R' )) = ('R'  asKoelnerPhoneticCode).
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
! !
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
!KoelnerPhoneticCodeStringComparatorTest class methodsFor:'documentation'!
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
version
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    ^ '$Header$'
305a09f0d01d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
! !
896
bf7016d7ffd2 class: RegressionTests::KoelnerPhoneticCodeStringComparatorTest
Stefan Vogel <sv@exept.de>
parents: 540
diff changeset
   120