#DOCUMENTATION by cg
class: RegressionTests::SoundexStringComparatorTest
added:
#test01_SomeCombinations
#test02_WellKnownResults
removed:
#testSomeCombinations
#testWellKnownResults
--- a/RegressionTests__SoundexStringComparatorTest.st Thu Jul 27 13:41:19 2017 +0200
+++ b/RegressionTests__SoundexStringComparatorTest.st Thu Jul 27 15:15:40 2017 +0200
@@ -18,24 +18,30 @@
!SoundexStringComparatorTest methodsFor:'tests'!
-testSomeCombinations
+test01_SomeCombinations
+ "tests regular soundex"
+
|code s|
"/ compares all 4-char combinations against
$A to:$Z do:[:c1 |
- $A to:$Z do:[:c2 |
- $A to:$Z do:[:c3 |
- $A to:$Z do:[:c4 |
- s := String with:c1 with:c2 with:c3 with:c4.
- code := (sc phoneticStringsFor:s) first.
- self assert:( code = s asSoundexCode).
- ].
- ].
- ].
+ $A to:$Z do:[:c2 |
+ $A to:$Z do:[:c3 |
+ $A to:$Z do:[:c4 |
+ s := String with:c1 with:c2 with:c3 with:c4.
+ code := (sc phoneticStringsFor:s) first.
+ self assert:( code = s asSoundexCode).
+ ].
+ ].
+ ].
].
+
+ "Created: / 27-07-2017 / 15:14:53 / cg"
!
-testWellKnownResults
+test02_WellKnownResults
+ "tests regular soundex"
+
|code soundex|
soundex := [:w | (sc phoneticStringsFor:w) first].
@@ -47,20 +53,20 @@
#( 'Acton' 'Ashdown' 'Ashton' 'Astin' 'Aston' 'Austen' 'Austin' 'Austine' 'Axten')
do:[:w |
- code := soundex value:(w).
- self assert:( code = 'A235').
+ code := soundex value:(w).
+ self assert:( code = 'A235').
].
#( 'Reader' 'Reeder' 'Rider' 'Ritter' 'Rothera' 'Rothra' 'Ruder' 'Rutter' 'Ryder')
do:[:w |
- code := soundex value:(w).
- self assert:( code = 'R360').
+ code := soundex value:(w).
+ self assert:( code = 'R360').
].
#( 'Wace' 'Waugh' 'Wookey')
do:[:w |
- code := soundex value:(w).
- self assert:( code = 'W200').
+ code := soundex value:(w).
+ self assert:( code = 'W200').
].
code := soundex value:('Abbot').
@@ -154,6 +160,13 @@
self assert: ( soundex value:( 'Lukaschowsky' )) = 'L222' .
self assert: ( soundex value:( 'McDonnell' )) = 'M235' .
self assert: ( soundex value:( 'McGee' )) = 'M200' .
+ self assert: ( soundex value:( 'Miller' )) = 'M460' .
+ self assert: ( soundex value:( 'Muller' )) = 'M460' .
+ self assert: ( soundex value:( 'Mueller' )) = 'M460' .
+ self assert: ( soundex value:( 'Milner' )) = 'M456' .
+ self assert: ( soundex value:( 'Millner' )) = 'M456' .
+ self assert: ( soundex value:( 'Miner' )) = 'M560' .
+ self assert: ( soundex value:( 'Mimer' )) = 'M560' .
self assert: ( soundex value:( 'O''Brien' )) = 'O165' .
self assert: ( soundex value:( 'Opnian' )) = 'O155' .
self assert: ( soundex value:( 'Oppenheimer' )) = 'O155' .
@@ -161,6 +174,8 @@
self assert: ( soundex value:( 'Riedemanas' )) = 'R355' .
self assert: ( soundex value:( 'Zita' )) = 'Z300' .
self assert: ( soundex value:( 'Zitzmeinn' )) = 'Z325' .
+
+ "Created: / 27-07-2017 / 15:14:59 / cg"
! !
!SoundexStringComparatorTest class methodsFor:'documentation'!