File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
src/AI-EditDistances-Tests Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,31 @@ AIEuclideanDistanceTest >> testEuclideanDistanceTwoDimensions [
4040 assert: (metric distanceBetween: #( 0 1 ) and : #( 1 0) )
4141 closeTo: 2 sqrt
4242]
43+
44+ { #category : ' *AI-EditDistances-Tests' }
45+ AIEuclideanDistanceTest >> testEmptyCollections [
46+
47+ " Tests that the Euclidean distance between two empty collections is 0."
48+ self assert: (metric distanceBetween: #() and : #() ) equals: 0 .
49+ ]
50+
51+ { #category : ' *AI-EditDistances-Tests' }
52+ AIEuclideanDistanceTest >> testIdenticalCollections [
53+
54+ " Tests that the Euclidean distance between identical collections is 0."
55+ self assert: (metric distanceBetween: #(1 2 3) and : #(1 2 3) ) equals: 0 .
56+ ]
57+
58+ { #category : ' *AI-EditDistances-Tests' }
59+ AIEuclideanDistanceTest >> testDifferentLengths [
60+
61+ " Tests that an error is raised for collections of different lengths."
62+ self should: [ metric distanceBetween: #(1 2) and : #(1 2 3) ] raise: Error .
63+ ]
64+
65+ { #category : ' *AI-EditDistances-Tests' }
66+ AIEuclideanDistanceTest >> testNonNumericInputs [
67+
68+ " Tests that an error is raised for non-numeric inputs."
69+ self should: [ metric distanceBetween: #(1 'a' 3) and : #(1 2 3) ] raise: Error .
70+ ]
You can’t perform that action at this time.
0 commit comments