17 ! ! |
17 ! ! |
18 |
18 |
19 !SoundexStringComparatorTest methodsFor:'tests'! |
19 !SoundexStringComparatorTest methodsFor:'tests'! |
20 |
20 |
21 test01_SomeCombinations |
21 test01_SomeCombinations |
22 "tests regular soundex" |
22 "tests if all char combinations up to size 4 can be soundexed" |
23 |
23 |
24 |code s| |
24 |code s| |
25 |
25 |
|
26 ^ self. |
|
27 |
26 self skip:'this test does not really test anything (except if all 4-char string combinations can be soundexed)'. |
28 self skip:'this test does not really test anything (except if all 4-char string combinations can be soundexed)'. |
27 |
29 |
28 "/ compares all 4-char combinations against what? |
|
29 $A to:$Z do:[:c1 | |
30 $A to:$Z do:[:c1 | |
|
31 s := String with:c1. |
|
32 code := (sc phoneticStringsFor:s) first. |
|
33 |
30 $A to:$Z do:[:c2 | |
34 $A to:$Z do:[:c2 | |
|
35 s := String with:c1 with:c2. |
|
36 code := (sc phoneticStringsFor:s) first. |
|
37 |
31 $A to:$Z do:[:c3 | |
38 $A to:$Z do:[:c3 | |
|
39 s := String with:c1 with:c2 with:c3. |
|
40 code := (sc phoneticStringsFor:s) first. |
|
41 |
32 $A to:$Z do:[:c4 | |
42 $A to:$Z do:[:c4 | |
33 s := String with:c1 with:c2 with:c3 with:c4. |
43 s := String with:c1 with:c2 with:c3 with:c4. |
34 code := (sc phoneticStringsFor:s) first. |
44 code := (sc phoneticStringsFor:s) first. |
35 self assert:( code = s asSoundexCode). |
45 self assert:( code = s asSoundexCode). |
36 ]. |
46 ]. |
37 ]. |
47 ]. |
38 ]. |
48 ]. |
39 ]. |
49 ]. |
40 |
50 |
41 "Created: / 27-07-2017 / 15:14:53 / cg" |
51 "Created: / 27-07-2017 / 15:14:53 / cg" |
42 "Modified: / 28-07-2017 / 09:43:53 / cg" |
52 "Modified: / 31-07-2017 / 17:51:21 / cg" |
43 ! |
53 ! |
44 |
54 |
45 test02_WellKnownResults |
55 test02_WellKnownResults |
46 "tests regular soundex" |
56 "tests regular soundex" |
47 |
57 |