From 536af26cea48ca7a5b3438d45acb7f11d2d33ce7 Mon Sep 17 00:00:00 2001 From: Torsten Bergmann Date: Mon, 20 Nov 2023 22:13:50 +0100 Subject: [PATCH] Cleanup: AIGraphReducerTest>>#mergedNodesIn: should use isNotNil Fix #37 and https://github.com/pharo-project/pharo/issues/15483 --- .../AIAstarTest.class.st | 26 ++++++------ .../AIBFSTest.class.st | 20 +++++----- .../AIBellmanFordTest.class.st | 18 +++++---- ...AICyclicNonWeightedComplexFixture.class.st | 22 +++++----- .../AICyclicNonWeightedSimpleFixture.class.st | 24 ++++++----- .../AICyclicWeightedComplexFixture.class.st | 18 +++++---- .../AICyclicWeightedSimpleFixture.class.st | 24 ++++++----- .../AIDijkstraTest.class.st | 26 ++++++------ .../AIDinicTest.class.st | 13 +++--- .../AIGraphAlgorithmTest.class.st | 16 ++++---- ...IGraphNonWeightedFixtureStructure.class.st | 10 +++-- .../AIGraphReducerTest.class.st | 40 ++++++++++--------- .../AIGraphTestFixtureStructure.class.st | 24 ++++++----- .../AIGraphWeightedFixtureStructure.class.st | 10 +++-- .../AIHitsTest.class.st | 24 ++++++----- .../AIKruskalTest.class.st | 20 +++++----- .../AILongestPathInDAGTest.class.st | 14 ++++--- .../AILongestPathInDCGTest.class.st | 18 +++++---- .../AINonWeightedDAGFixture.class.st | 18 +++++---- .../AIPrimTest.class.st | 16 ++++---- .../AIShortestPathInDAGTest.class.st | 14 ++++--- .../AITarjanTest.class.st | 24 ++++++----- .../AITopologicalSortingTest.class.st | 22 +++++----- .../AIWeightedDAGFixture.class.st | 14 ++++--- .../AIWeightedHitsTest.class.st | 20 +++++----- .../DummyTestingPerson.class.st | 22 +++++----- .../ManifestAIAlgorithmsGraphTests.class.st | 10 +++-- src/AI-Algorithms-Graph-Tests/package.st | 2 +- 28 files changed, 291 insertions(+), 238 deletions(-) diff --git a/src/AI-Algorithms-Graph-Tests/AIAstarTest.class.st b/src/AI-Algorithms-Graph-Tests/AIAstarTest.class.st index 8debd90..5ef3056 100644 --- a/src/AI-Algorithms-Graph-Tests/AIAstarTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIAstarTest.class.st @@ -1,19 +1,21 @@ Class { - #name : #AIAstarTest, - #superclass : #TestCase, + #name : 'AIAstarTest', + #superclass : 'TestCase', #instVars : [ 'astar' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIAstarTest >> setUp [ super setUp. astar := AIAstar new ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testAseBasicCircuit [ |graphType graph | @@ -39,7 +41,7 @@ AIAstarTest >> testAseBasicCircuit [ self assert: Float infinity equals: (astar findNode: $a) pathDistance ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testAseBasicCircuitBacktrack [ |graphType graph | @@ -73,7 +75,7 @@ AIAstarTest >> testAseBasicCircuitBacktrack [ reconstructPath)) ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testComplexWeightedGraph2 [ @@ -95,7 +97,7 @@ AIAstarTest >> testComplexWeightedGraph2 [ self assert: (astar findNode: 5) pathDistance equals: 10 ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testComplexWeightedGraph2BackTracking [ | shortestPath graphType graph | @@ -138,7 +140,7 @@ AIAstarTest >> testComplexWeightedGraph2BackTracking [ astar reset ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testComplexWeightedGraph3 [ |graphType graph | @@ -158,7 +160,7 @@ AIAstarTest >> testComplexWeightedGraph3 [ self assert: (astar findNode: $e) pathDistance equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testComplexWeightedGraph3Backtracking [ | shortestPath graphType graph | @@ -195,7 +197,7 @@ AIAstarTest >> testComplexWeightedGraph3Backtracking [ astar reset ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testSimpleWeightedGraph [ |graphType graph | @@ -215,7 +217,7 @@ AIAstarTest >> testSimpleWeightedGraph [ self assert: (astar findNode: 5) pathDistance equals: 3 ] -{ #category : #tests } +{ #category : 'tests' } AIAstarTest >> testSimpleWeightedGraphBacktracking [ | shortestPath graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AIBFSTest.class.st b/src/AI-Algorithms-Graph-Tests/AIBFSTest.class.st index 0aa0d63..265afe1 100644 --- a/src/AI-Algorithms-Graph-Tests/AIBFSTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIBFSTest.class.st @@ -1,19 +1,21 @@ Class { - #name : #AIBFSTest, - #superclass : #TestCase, + #name : 'AIBFSTest', + #superclass : 'TestCase', #instVars : [ 'bfsp' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIBFSTest >> setUp [ super setUp. bfsp := AIBFS new ] -{ #category : #tests } +{ #category : 'tests' } AIBFSTest >> testAseGraph [ |graph graphType| @@ -32,7 +34,7 @@ AIBFSTest >> testAseGraph [ self assert: (#() hasEqualElements: (bfsp runFrom: $f to: $a)) ] -{ #category : #tests } +{ #category : 'tests' } AIBFSTest >> testAseSccGraph [ |graph graphType| @@ -45,7 +47,7 @@ AIBFSTest >> testAseSccGraph [ self assert: (#( $a $b $d ) hasEqualElements: (bfsp runFrom: $a to: $d)) ] -{ #category : #tests } +{ #category : 'tests' } AIBFSTest >> testComplexUndirectedGraph [ |graph graphType| @@ -62,7 +64,7 @@ AIBFSTest >> testComplexUndirectedGraph [ self assert: (#( 4 3 2 12 9 ) hasEqualElements: (bfsp runFrom: 4 to: 9)) ] -{ #category : #tests } +{ #category : 'tests' } AIBFSTest >> testSimpleGraph [ |graph graphType| @@ -74,7 +76,7 @@ AIBFSTest >> testSimpleGraph [ self assert: (#( $d $c ) hasEqualElements: (bfsp runFrom: $d to: $c)) ] -{ #category : #tests } +{ #category : 'tests' } AIBFSTest >> testWithoutCyclesComplexGraph [ |graph graphType| diff --git a/src/AI-Algorithms-Graph-Tests/AIBellmanFordTest.class.st b/src/AI-Algorithms-Graph-Tests/AIBellmanFordTest.class.st index 44ae331..9473eb8 100644 --- a/src/AI-Algorithms-Graph-Tests/AIBellmanFordTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIBellmanFordTest.class.st @@ -2,21 +2,23 @@ An AIBellmanFordTest is a test class for testing the behavior of AIBellmanFord " Class { - #name : #AIBellmanFordTest, - #superclass : #TestCase, + #name : 'AIBellmanFordTest', + #superclass : 'TestCase', #instVars : [ 'bellmanFord' ], - #category : #'AI-Algorithms-Graph-Tests-Shortest path' + #category : 'AI-Algorithms-Graph-Tests-Shortest path', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Shortest path' } -{ #category : #running } +{ #category : 'running' } AIBellmanFordTest >> setUp [ super setUp. bellmanFord := AIBellmanFord new ] -{ #category : #tests } +{ #category : 'tests' } AIBellmanFordTest >> testNegativeUnconnectedWeightedGraph [ |graphType graph | @@ -44,7 +46,7 @@ AIBellmanFordTest >> testNegativeUnconnectedWeightedGraph [ self assert: (bellmanFord findNode: 9) pathDistance equals: Float negativeInfinity ] -{ #category : #tests } +{ #category : 'tests' } AIBellmanFordTest >> testNegativeWeightedGraph [ |graphType graph | @@ -71,7 +73,7 @@ AIBellmanFordTest >> testNegativeWeightedGraph [ self assert: (bellmanFord findNode: 9) pathDistance equals: Float negativeInfinity ] -{ #category : #tests } +{ #category : 'tests' } AIBellmanFordTest >> testNegativeWeightedGraph2 [ |graphType graph | @@ -99,7 +101,7 @@ AIBellmanFordTest >> testNegativeWeightedGraph2 [ self assert: (bellmanFord findNode: 9) pathDistance equals: Float negativeInfinity ] -{ #category : #tests } +{ #category : 'tests' } AIBellmanFordTest >> testNegativeWeightedGraphReconstrucPath [ |graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedComplexFixture.class.st b/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedComplexFixture.class.st index e720d78..b011097 100644 --- a/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedComplexFixture.class.st +++ b/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedComplexFixture.class.st @@ -6,8 +6,8 @@ Graph Class: 4. Complex Graphs " Class { - #name : #AICyclicNonWeightedComplexFixture, - #superclass : #Object, + #name : 'AICyclicNonWeightedComplexFixture', + #superclass : 'Object', #instVars : [ 'complexCycleGraph', 'complexCycleGraph2', @@ -15,10 +15,12 @@ Class { 'stronglyConnectedGraph', 'stronglyConnectedGraphWithObjects' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedComplexFixture >> complexCycleGraph [ "https://i.imgur.com/4trPCcb.jpeg" @@ -35,7 +37,7 @@ AICyclicNonWeightedComplexFixture >> complexCycleGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedComplexFixture >> complexCycleGraph2 [ | nodes edges graph| nodes := $a to: $i. @@ -52,7 +54,7 @@ AICyclicNonWeightedComplexFixture >> complexCycleGraph2 [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedComplexFixture >> complexUndirectedGraph [ "https://i.imgur.com/qK2zsYb.png" @@ -72,7 +74,7 @@ AICyclicNonWeightedComplexFixture >> complexUndirectedGraph [ ^graph ] -{ #category : #initialization } +{ #category : 'initialization' } AICyclicNonWeightedComplexFixture >> initialize [ |persons| super initialize . @@ -84,7 +86,7 @@ AICyclicNonWeightedComplexFixture >> initialize [ stronglyConnectedGraphWithObjects := self stronglyConnectedGraph: persons. ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedComplexFixture >> stronglyConnectedGraph [ "This a graph for 4 strongly connected components " @@ -102,7 +104,7 @@ AICyclicNonWeightedComplexFixture >> stronglyConnectedGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedComplexFixture >> stronglyConnectedGraph: objects [ "This is the exact same graph as #stronglyConnectedGraph: but using a custom object" @@ -122,7 +124,7 @@ AICyclicNonWeightedComplexFixture >> stronglyConnectedGraph: objects [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedComplexFixture >> stronglyConnectedGraph: graphBuilder withObjects: objects [ "This is the exact same graph as #stronglyConnectedGraph: but using a custom object" diff --git a/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedSimpleFixture.class.st b/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedSimpleFixture.class.st index 93b6de2..59709fd 100644 --- a/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedSimpleFixture.class.st +++ b/src/AI-Algorithms-Graph-Tests/AICyclicNonWeightedSimpleFixture.class.st @@ -6,8 +6,8 @@ Graph Class: 4. Simple Graphs " Class { - #name : #AICyclicNonWeightedSimpleFixture, - #superclass : #Object, + #name : 'AICyclicNonWeightedSimpleFixture', + #superclass : 'Object', #instVars : [ 'aseCircuitGraph', 'aseSccGraph', @@ -17,10 +17,12 @@ Class { 'nestedCycleGraph', 'simpleGraphForHits' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> aseCircuitGraph [ "https://i.imgur.com/t1S6dG4.jpeg" @@ -37,7 +39,7 @@ AICyclicNonWeightedSimpleFixture >> aseCircuitGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> aseSccGraph [ | nodes edges graph| @@ -50,7 +52,7 @@ AICyclicNonWeightedSimpleFixture >> aseSccGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> cycleGraph [ "https://i.imgur.com/MNtwA56.jpeg" @@ -65,7 +67,7 @@ AICyclicNonWeightedSimpleFixture >> cycleGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> dependencyGraph [ | nodes edges graph| @@ -80,7 +82,7 @@ AICyclicNonWeightedSimpleFixture >> dependencyGraph [ ^graph ] -{ #category : #initialization } +{ #category : 'initialization' } AICyclicNonWeightedSimpleFixture >> initialize [ super initialize . aseCircuitGraph := self aseCircuitGraph . @@ -92,7 +94,7 @@ AICyclicNonWeightedSimpleFixture >> initialize [ simpleGraphForHits := self simpleGraphForHits . ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> moduleGraph [ | nodes edges graph | @@ -114,7 +116,7 @@ AICyclicNonWeightedSimpleFixture >> moduleGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> nestedCycleGraph [ "https://i.imgur.com/6lk0pmR.jpeg" @@ -131,7 +133,7 @@ AICyclicNonWeightedSimpleFixture >> nestedCycleGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicNonWeightedSimpleFixture >> simpleGraphForHits [ "https://i.imgur.com/FvqrFbf.png" diff --git a/src/AI-Algorithms-Graph-Tests/AICyclicWeightedComplexFixture.class.st b/src/AI-Algorithms-Graph-Tests/AICyclicWeightedComplexFixture.class.st index 1db25d6..1c89af8 100644 --- a/src/AI-Algorithms-Graph-Tests/AICyclicWeightedComplexFixture.class.st +++ b/src/AI-Algorithms-Graph-Tests/AICyclicWeightedComplexFixture.class.st @@ -6,18 +6,20 @@ Graph Class: 4. Complex Graphs " Class { - #name : #AICyclicWeightedComplexFixture, - #superclass : #Object, + #name : 'AICyclicWeightedComplexFixture', + #superclass : 'Object', #instVars : [ 'complexWeightedGraph', 'complexWeightedGraph2', 'complexWeightedGraph3', 'complexWeightedGraph4' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedComplexFixture >> complexWeightedGraph [ "https://i.imgur.com/LAy4W3Z.jpeg" @@ -37,7 +39,7 @@ AICyclicWeightedComplexFixture >> complexWeightedGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedComplexFixture >> complexWeightedGraph2 [ "https://i.imgur.com/Syyd7YI.png" @@ -53,7 +55,7 @@ AICyclicWeightedComplexFixture >> complexWeightedGraph2 [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedComplexFixture >> complexWeightedGraph3 [ "https://i.imgur.com/0kgPUQM.png" @@ -70,7 +72,7 @@ AICyclicWeightedComplexFixture >> complexWeightedGraph3 [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedComplexFixture >> complexWeightedGraph4 [ "https://imgur.com/Szd19hW" @@ -92,7 +94,7 @@ AICyclicWeightedComplexFixture >> complexWeightedGraph4 [ ^graph ] -{ #category : #initialization } +{ #category : 'initialization' } AICyclicWeightedComplexFixture >> initialize [ super initialize . complexWeightedGraph := self complexWeightedGraph . diff --git a/src/AI-Algorithms-Graph-Tests/AICyclicWeightedSimpleFixture.class.st b/src/AI-Algorithms-Graph-Tests/AICyclicWeightedSimpleFixture.class.st index 86ef8a8..a7cad43 100644 --- a/src/AI-Algorithms-Graph-Tests/AICyclicWeightedSimpleFixture.class.st +++ b/src/AI-Algorithms-Graph-Tests/AICyclicWeightedSimpleFixture.class.st @@ -6,8 +6,8 @@ Graph Class: 4. Simple Graphs " Class { - #name : #AICyclicWeightedSimpleFixture, - #superclass : #Object, + #name : 'AICyclicWeightedSimpleFixture', + #superclass : 'Object', #instVars : [ 'aseCircuitWeightedGraph', 'aseWeightedCircuitGraph', @@ -17,10 +17,12 @@ Class { 'simpleWeightedGraph', 'simpleWeightedGraph2' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> aseCircuitWeightedGraph [ "This is the same graph, but with weights of 1 to all edges" @@ -38,7 +40,7 @@ AICyclicWeightedSimpleFixture >> aseCircuitWeightedGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> aseWeightedCircuitGraph [ | nodes edges graph | @@ -53,7 +55,7 @@ AICyclicWeightedSimpleFixture >> aseWeightedCircuitGraph [ ^graph ] -{ #category : #initialization } +{ #category : 'initialization' } AICyclicWeightedSimpleFixture >> initialize [ super initialize . aseCircuitWeightedGraph := self aseCircuitWeightedGraph . @@ -65,7 +67,7 @@ AICyclicWeightedSimpleFixture >> initialize [ simpleWeightedGraph2 := self simpleWeightedGraph2 . ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> negativeUnconnectedWeightedGraph [ "https://i.imgur.com/EKPxvx7.png" @@ -81,7 +83,7 @@ AICyclicWeightedSimpleFixture >> negativeUnconnectedWeightedGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> negativeWeightedGraph [ "https://i.imgur.com/GsnrKtx.png" @@ -98,7 +100,7 @@ AICyclicWeightedSimpleFixture >> negativeWeightedGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> negativeWeightedGraph2 [ "https://i.imgur.com/R3EV1pl.png" @@ -114,7 +116,7 @@ AICyclicWeightedSimpleFixture >> negativeWeightedGraph2 [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> simpleWeightedGraph [ "https://i.imgur.com/AQTX2hz.jpeg" @@ -130,7 +132,7 @@ AICyclicWeightedSimpleFixture >> simpleWeightedGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AICyclicWeightedSimpleFixture >> simpleWeightedGraph2 [ "https://imgur.com/6Mjdngn" diff --git a/src/AI-Algorithms-Graph-Tests/AIDijkstraTest.class.st b/src/AI-Algorithms-Graph-Tests/AIDijkstraTest.class.st index ce7259c..3f00ab7 100644 --- a/src/AI-Algorithms-Graph-Tests/AIDijkstraTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIDijkstraTest.class.st @@ -1,19 +1,21 @@ Class { - #name : #AIDijkstraTest, - #superclass : #TestCase, + #name : 'AIDijkstraTest', + #superclass : 'TestCase', #instVars : [ 'dijkstra' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIDijkstraTest >> setUp [ super setUp. dijkstra := AIDijkstra new ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testAseBasicCircuit [ |graphType graph | @@ -39,7 +41,7 @@ AIDijkstraTest >> testAseBasicCircuit [ self assert: Float infinity equals: (dijkstra findNode: $a) pathDistance ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testAseBasicCircuitBacktrack [ |graphType graph | @@ -73,7 +75,7 @@ AIDijkstraTest >> testAseBasicCircuitBacktrack [ reconstructPath)) ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testComplexWeightedGraph2 [ @@ -95,7 +97,7 @@ AIDijkstraTest >> testComplexWeightedGraph2 [ self assert: (dijkstra findNode: 5) pathDistance equals: 10 ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testComplexWeightedGraph2BackTracking [ | shortestPath graphType graph | @@ -138,7 +140,7 @@ AIDijkstraTest >> testComplexWeightedGraph2BackTracking [ dijkstra reset ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testComplexWeightedGraph3 [ | graphType graph | @@ -158,7 +160,7 @@ AIDijkstraTest >> testComplexWeightedGraph3 [ self assert: (dijkstra findNode: $e) pathDistance equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testComplexWeightedGraph3Backtracking [ | shortestPath graphType graph | @@ -195,7 +197,7 @@ AIDijkstraTest >> testComplexWeightedGraph3Backtracking [ dijkstra reset ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testSimpleWeightedGraph [ |graphType graph | @@ -215,7 +217,7 @@ AIDijkstraTest >> testSimpleWeightedGraph [ self assert: (dijkstra findNode: 5) pathDistance equals: 3 ] -{ #category : #tests } +{ #category : 'tests' } AIDijkstraTest >> testSimpleWeightedGraphBacktracking [ | shortestPath graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AIDinicTest.class.st b/src/AI-Algorithms-Graph-Tests/AIDinicTest.class.st index 598b2d3..b77b82d 100644 --- a/src/AI-Algorithms-Graph-Tests/AIDinicTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIDinicTest.class.st @@ -1,20 +1,21 @@ Class { - #name : #AIDinicTest, - #superclass : #TestCase, + #name : 'AIDinicTest', + #superclass : 'TestCase', #instVars : [ 'dinic' ], - #category : #'AI-Algorithms-Graph-Tests' + #category : 'AI-Algorithms-Graph-Tests', + #package : 'AI-Algorithms-Graph-Tests' } -{ #category : #running } +{ #category : 'running' } AIDinicTest >> setUp [ super setUp. dinic := AIDinic new. ] -{ #category : #tests } +{ #category : 'tests' } AIDinicTest >> testComplexFlow [ | graphType graph value | @@ -34,7 +35,7 @@ AIDinicTest >> testComplexFlow [ self assert: value equals: 2. ] -{ #category : #tests } +{ #category : 'tests' } AIDinicTest >> testSimpleFlow [ | graphType graph value | diff --git a/src/AI-Algorithms-Graph-Tests/AIGraphAlgorithmTest.class.st b/src/AI-Algorithms-Graph-Tests/AIGraphAlgorithmTest.class.st index 75bb8fa..2d3c10e 100644 --- a/src/AI-Algorithms-Graph-Tests/AIGraphAlgorithmTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIGraphAlgorithmTest.class.st @@ -2,12 +2,14 @@ A MalGraphAlgorithmTest is a test class for testing the behavior of MalGraphAlgorithm " Class { - #name : #AIGraphAlgorithmTest, - #superclass : #TestCase, - #category : #'AI-Algorithms-Graph-Tests-Tests' + #name : 'AIGraphAlgorithmTest', + #superclass : 'TestCase', + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #tests } +{ #category : 'tests' } AIGraphAlgorithmTest >> testAddNodesFromChildrenBlock [ | builder | @@ -30,7 +32,7 @@ AIGraphAlgorithmTest >> testAddNodesFromChildrenBlock [ self assert: (builder findNode: ByteSymbol) adjacentNodes isEmpty ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } AIGraphAlgorithmTest >> testingAddingNodes [ |graphType graph dijkstra| @@ -51,7 +53,7 @@ AIGraphAlgorithmTest >> testingAddingNodes [ ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } AIGraphAlgorithmTest >> testingFindingNodes [ |graphType graph dijkstra| @@ -68,7 +70,7 @@ AIGraphAlgorithmTest >> testingFindingNodes [ self assert: Float infinity equals: (dijkstra findNode: $g) pathDistance. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } AIGraphAlgorithmTest >> testingNodeDictionary [ |graphType graph dijkstra| diff --git a/src/AI-Algorithms-Graph-Tests/AIGraphNonWeightedFixtureStructure.class.st b/src/AI-Algorithms-Graph-Tests/AIGraphNonWeightedFixtureStructure.class.st index 9aca123..83f38c1 100644 --- a/src/AI-Algorithms-Graph-Tests/AIGraphNonWeightedFixtureStructure.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIGraphNonWeightedFixtureStructure.class.st @@ -4,12 +4,14 @@ Structure of Non Weighted Graphs - edges " Class { - #name : #AIGraphNonWeightedFixtureStructure, - #superclass : #AIGraphTestFixtureStructure, - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #name : 'AIGraphNonWeightedFixtureStructure', + #superclass : 'AIGraphTestFixtureStructure', + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #'drawing - roassal' } +{ #category : 'drawing - roassal' } AIGraphNonWeightedFixtureStructure >> buildGraphCanvas [ | canvas | diff --git a/src/AI-Algorithms-Graph-Tests/AIGraphReducerTest.class.st b/src/AI-Algorithms-Graph-Tests/AIGraphReducerTest.class.st index a1b7c63..cbe5099 100644 --- a/src/AI-Algorithms-Graph-Tests/AIGraphReducerTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIGraphReducerTest.class.st @@ -1,13 +1,15 @@ Class { - #name : #AIGraphReducerTest, - #superclass : #TestCase, + #name : 'AIGraphReducerTest', + #superclass : 'TestCase', #instVars : [ 'graphReducer' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #helpers } +{ #category : 'helpers' } AIGraphReducerTest >> assertNodes: aNodeList doesNotInclude: anotherNodeList [ aNodeList collect: [ :each | each model ] thenDo: [ :model | @@ -16,21 +18,21 @@ AIGraphReducerTest >> assertNodes: aNodeList doesNotInclude: anotherNodeList [ description: model asString , ' should not be referenced!' ] ] -{ #category : #helpers } +{ #category : 'helpers' } AIGraphReducerTest >> mergedNodesIn: aNodeList [ - ^ (aNodeList select: [ :node | node mergedNodes notNil ]) + ^ (aNodeList select: [ :node | node mergedNodes isNotNil ]) flatCollect: #mergedNodes ] -{ #category : #running } +{ #category : 'running' } AIGraphReducerTest >> setUp [ super setUp. graphReducer := AIGraphReducer new ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testAdjacenciesFor [ | nodes graphType graph| @@ -48,7 +50,7 @@ AIGraphReducerTest >> testAdjacenciesFor [ equals: #( $a $b $d $e $i ) ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testComplexCycle [ | mergedNodes graphType graph| @@ -73,7 +75,7 @@ AIGraphReducerTest >> testComplexCycle [ collapsedNode includesAll: #( $c $d $f ) ]) ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testComplexCycle2 [ | graphType graph| @@ -86,7 +88,7 @@ AIGraphReducerTest >> testComplexCycle2 [ self assert: (graphReducer nodes at: 6) mergedNodes size equals: 4 ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testComplexCycleReferences [ | mergedNodes reducedNodeA reducedNodeB reducedNodeE reducedNodeCDF reducedNodeGH graphType graph| @@ -135,7 +137,7 @@ AIGraphReducerTest >> testComplexCycleReferences [ self assert: reducedNodeCDF adjacentNodes size equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testGraphReducingWhenNoCycle [ | initialGraph graphType graph| @@ -148,7 +150,7 @@ AIGraphReducerTest >> testGraphReducingWhenNoCycle [ self assert: initialGraph equals: graphReducer graph ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testGraphReducingWhenNoCycleReferences [ | reducedNodeA reducedNodeB reducedNodeC reducedNodeD graphType graph| @@ -177,7 +179,7 @@ AIGraphReducerTest >> testGraphReducingWhenNoCycleReferences [ self assert: reducedNodeC adjacentNodes isEmpty ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testMergedNodesNotReferencedInNextNodes [ | graphType graph| @@ -191,7 +193,7 @@ AIGraphReducerTest >> testMergedNodesNotReferencedInNextNodes [ doesNotInclude: (self mergedNodesIn: graphReducer nodes) ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testMergedNodesNotReferencedInNextNodesC2 [ | graphType graph| @@ -205,7 +207,7 @@ AIGraphReducerTest >> testMergedNodesNotReferencedInNextNodesC2 [ doesNotInclude: (self mergedNodesIn: graphReducer nodes) ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testMergedNodesNotReferencedInNextNodesForSCG [ | graphType graph| @@ -219,7 +221,7 @@ AIGraphReducerTest >> testMergedNodesNotReferencedInNextNodesForSCG [ doesNotInclude: (self mergedNodesIn: graphReducer nodes) ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testNoCycle [ | graphType graph| @@ -234,7 +236,7 @@ AIGraphReducerTest >> testNoCycle [ description: node asString , ' node is in cycle!' ] ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testStronglyConnectedGraph [ | nodeModels nodeModelsCollection graphType graph| @@ -256,7 +258,7 @@ AIGraphReducerTest >> testStronglyConnectedGraph [ aNodeModel includesAll: #( $f $g $h ) ]) ] -{ #category : #tests } +{ #category : 'tests' } AIGraphReducerTest >> testStronglyConnectedGraphReferences [ | reducedNodeI mergedNodes reducedNodeABC reducedNodeDE reducedNodeFGH graphType graph| diff --git a/src/AI-Algorithms-Graph-Tests/AIGraphTestFixtureStructure.class.st b/src/AI-Algorithms-Graph-Tests/AIGraphTestFixtureStructure.class.st index 603a581..3c55b86 100644 --- a/src/AI-Algorithms-Graph-Tests/AIGraphTestFixtureStructure.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIGraphTestFixtureStructure.class.st @@ -1,32 +1,34 @@ Class { - #name : #AIGraphTestFixtureStructure, - #superclass : #Object, + #name : 'AIGraphTestFixtureStructure', + #superclass : 'Object', #instVars : [ 'nodes', 'edges' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #'drawing - roassal' } +{ #category : 'drawing - roassal' } AIGraphTestFixtureStructure >> buildGraphCanvas [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } AIGraphTestFixtureStructure >> edges [ ^ edges ] -{ #category : #accessing } +{ #category : 'accessing' } AIGraphTestFixtureStructure >> edges: anObject [ edges := anObject ] -{ #category : #inspector } +{ #category : 'inspector' } AIGraphTestFixtureStructure >> inspectGraph [ @@ -37,25 +39,25 @@ AIGraphTestFixtureStructure >> inspectGraph [ yourself ] -{ #category : #inspector } +{ #category : 'inspector' } AIGraphTestFixtureStructure >> inspectGraphContext: aContext [ aContext withoutEvaluator ] -{ #category : #accessing } +{ #category : 'accessing' } AIGraphTestFixtureStructure >> nodes [ ^ nodes ] -{ #category : #accessing } +{ #category : 'accessing' } AIGraphTestFixtureStructure >> nodes: asObject [ nodes := asObject ] -{ #category : #'drawing - roassal' } +{ #category : 'drawing - roassal' } AIGraphTestFixtureStructure >> nodesAsRoassalShapes [ |nodesAsRoassalShapes | diff --git a/src/AI-Algorithms-Graph-Tests/AIGraphWeightedFixtureStructure.class.st b/src/AI-Algorithms-Graph-Tests/AIGraphWeightedFixtureStructure.class.st index d683187..178e77b 100644 --- a/src/AI-Algorithms-Graph-Tests/AIGraphWeightedFixtureStructure.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIGraphWeightedFixtureStructure.class.st @@ -5,12 +5,14 @@ Structure of Weighted Graphs - weight " Class { - #name : #AIGraphWeightedFixtureStructure, - #superclass : #AIGraphTestFixtureStructure, - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #name : 'AIGraphWeightedFixtureStructure', + #superclass : 'AIGraphTestFixtureStructure', + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #'drawing - roassal' } +{ #category : 'drawing - roassal' } AIGraphWeightedFixtureStructure >> buildGraphCanvas [ | canvas arrowHeight marker attachedPoint interaction | diff --git a/src/AI-Algorithms-Graph-Tests/AIHitsTest.class.st b/src/AI-Algorithms-Graph-Tests/AIHitsTest.class.st index 1bc0a91..ec2fae1 100644 --- a/src/AI-Algorithms-Graph-Tests/AIHitsTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIHitsTest.class.st @@ -1,20 +1,22 @@ Class { - #name : #AIHitsTest, - #superclass : #TestCase, + #name : 'AIHitsTest', + #superclass : 'TestCase', #instVars : [ 'hits' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIHitsTest >> setUp [ super setUp. hits := AIHits new ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testComplexCycle [ | graphType graph| @@ -28,7 +30,7 @@ AIHitsTest >> testComplexCycle [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testComplexWCycle [ | graphType graph | @@ -46,7 +48,7 @@ AIHitsTest >> testComplexWCycle [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testCycle [ | graphType graph| @@ -60,7 +62,7 @@ AIHitsTest >> testCycle [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testGraphForHits [ | graphType graph| @@ -75,7 +77,7 @@ AIHitsTest >> testGraphForHits [ self deny: node auth equals: 0 ] ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testNestedCycle [ | graphType graph| @@ -89,7 +91,7 @@ AIHitsTest >> testNestedCycle [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testSimple [ | graphType graph| @@ -103,7 +105,7 @@ AIHitsTest >> testSimple [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIHitsTest >> testSimpleW [ | graphType graph| diff --git a/src/AI-Algorithms-Graph-Tests/AIKruskalTest.class.st b/src/AI-Algorithms-Graph-Tests/AIKruskalTest.class.st index ba99005..a3522b0 100644 --- a/src/AI-Algorithms-Graph-Tests/AIKruskalTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIKruskalTest.class.st @@ -1,14 +1,16 @@ Class { - #name : #AIKruskalTest, - #superclass : #TestCase, + #name : 'AIKruskalTest', + #superclass : 'TestCase', #instVars : [ 'nodes', 'kruskal' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIKruskalTest >> setUp [ super setUp. @@ -20,7 +22,7 @@ AIKruskalTest >> setUp [ nodes add: AIDisjointSetNode new ] -{ #category : #tests } +{ #category : 'tests' } AIKruskalTest >> testMaxSpanningTreeComplex [ | tree expectedEdges graphType graph | @@ -47,7 +49,7 @@ AIKruskalTest >> testMaxSpanningTreeComplex [ equals: 223 ] -{ #category : #tests } +{ #category : 'tests' } AIKruskalTest >> testMaxSpanningTreeSimple [ | tree expectedEdges graphType graph | @@ -69,7 +71,7 @@ AIKruskalTest >> testMaxSpanningTreeSimple [ equals: 17 ] -{ #category : #tests } +{ #category : 'tests' } AIKruskalTest >> testMinSpanningTreeComplex [ | tree graphType graph | @@ -88,7 +90,7 @@ AIKruskalTest >> testMinSpanningTreeComplex [ equals: 164 ] -{ #category : #tests } +{ #category : 'tests' } AIKruskalTest >> testMinSpanningTreeComplexDisconnected [ | tree graphType graph | @@ -107,7 +109,7 @@ AIKruskalTest >> testMinSpanningTreeComplexDisconnected [ equals: 95 ] -{ #category : #tests } +{ #category : 'tests' } AIKruskalTest >> testMinSpanningTreeSimple [ | tree expectedEdges graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AILongestPathInDAGTest.class.st b/src/AI-Algorithms-Graph-Tests/AILongestPathInDAGTest.class.st index db2bd56..844c898 100644 --- a/src/AI-Algorithms-Graph-Tests/AILongestPathInDAGTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AILongestPathInDAGTest.class.st @@ -1,20 +1,22 @@ Class { - #name : #AILongestPathInDAGTest, - #superclass : #TestCase, + #name : 'AILongestPathInDAGTest', + #superclass : 'TestCase', #instVars : [ 'longestPathAlgo' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AILongestPathInDAGTest >> setUp [ super setUp. longestPathAlgo := AILongestPathInDAG new ] -{ #category : #tests } +{ #category : 'tests' } AILongestPathInDAGTest >> testWeightedDAG [ | longestPath graphType graph | @@ -51,7 +53,7 @@ AILongestPathInDAGTest >> testWeightedDAG [ self assert: longestPath asArray equals: #( ) ] -{ #category : #tests } +{ #category : 'tests' } AILongestPathInDAGTest >> testWithoutCyclesComplexWeightedGraph [ | longestPath graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AILongestPathInDCGTest.class.st b/src/AI-Algorithms-Graph-Tests/AILongestPathInDCGTest.class.st index 40c201b..fd61cb2 100644 --- a/src/AI-Algorithms-Graph-Tests/AILongestPathInDCGTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AILongestPathInDCGTest.class.st @@ -1,19 +1,21 @@ Class { - #name : #AILongestPathInDCGTest, - #superclass : #TestCase, + #name : 'AILongestPathInDCGTest', + #superclass : 'TestCase', #instVars : [ 'longestPathAlgo' ], - #category : #'AI-Algorithms-Graph-Tests-Shortest path' + #category : 'AI-Algorithms-Graph-Tests-Shortest path', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Shortest path' } -{ #category : #running } +{ #category : 'running' } AILongestPathInDCGTest >> setUp [ super setUp. longestPathAlgo := AILongestPathInDCG new ] -{ #category : #tests } +{ #category : 'tests' } AILongestPathInDCGTest >> testNegativeUnconnectedWeightedGraph [ |graphType graph | @@ -41,7 +43,7 @@ AILongestPathInDCGTest >> testNegativeUnconnectedWeightedGraph [ self assert: (longestPathAlgo findNode: 9) pathDistance equals: 200 ] -{ #category : #tests } +{ #category : 'tests' } AILongestPathInDCGTest >> testNegativeWeightedGraph [ |graphType graph | @@ -68,7 +70,7 @@ AILongestPathInDCGTest >> testNegativeWeightedGraph [ self assert: (longestPathAlgo findNode: 9) pathDistance equals: 200 ] -{ #category : #tests } +{ #category : 'tests' } AILongestPathInDCGTest >> testNegativeWeightedGraph2 [ |graphType graph | @@ -96,7 +98,7 @@ AILongestPathInDCGTest >> testNegativeWeightedGraph2 [ self assert: (longestPathAlgo findNode: 9) pathDistance equals: 200 ] -{ #category : #tests } +{ #category : 'tests' } AILongestPathInDCGTest >> testNegativeWeightedGraphReconstrucPath [ |graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AINonWeightedDAGFixture.class.st b/src/AI-Algorithms-Graph-Tests/AINonWeightedDAGFixture.class.st index 1f29279..90f7bec 100644 --- a/src/AI-Algorithms-Graph-Tests/AINonWeightedDAGFixture.class.st +++ b/src/AI-Algorithms-Graph-Tests/AINonWeightedDAGFixture.class.st @@ -5,18 +5,20 @@ Graph Class: 3. Directed graphs " Class { - #name : #AINonWeightedDAGFixture, - #superclass : #Object, + #name : 'AINonWeightedDAGFixture', + #superclass : 'Object', #instVars : [ 'moduleGraph2', 'simpleGraph', 'withoutCyclesComplexGraph', 'withoutCyclesMediumGraph' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #initialization } +{ #category : 'initialization' } AINonWeightedDAGFixture >> initialize [ super initialize . moduleGraph2 := self moduleGraph2 . @@ -25,7 +27,7 @@ AINonWeightedDAGFixture >> initialize [ withoutCyclesMediumGraph := self withoutCyclesMediumGraph . ] -{ #category : #fixtures } +{ #category : 'fixtures' } AINonWeightedDAGFixture >> moduleGraph2 [ "sample graph from Habib et al for modular decomposition" @@ -42,7 +44,7 @@ AINonWeightedDAGFixture >> moduleGraph2 [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AINonWeightedDAGFixture >> simpleGraph [ "https://i.imgur.com/uJwu5xS.jpeg" @@ -57,7 +59,7 @@ AINonWeightedDAGFixture >> simpleGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AINonWeightedDAGFixture >> withoutCyclesComplexGraph [ "for longest path algo" @@ -77,7 +79,7 @@ AINonWeightedDAGFixture >> withoutCyclesComplexGraph [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AINonWeightedDAGFixture >> withoutCyclesMediumGraph [ "for longest path algo" diff --git a/src/AI-Algorithms-Graph-Tests/AIPrimTest.class.st b/src/AI-Algorithms-Graph-Tests/AIPrimTest.class.st index 948a269..b31e438 100644 --- a/src/AI-Algorithms-Graph-Tests/AIPrimTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIPrimTest.class.st @@ -1,20 +1,22 @@ Class { - #name : #AIPrimTest, - #superclass : #TestCase, + #name : 'AIPrimTest', + #superclass : 'TestCase', #instVars : [ 'prim' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIPrimTest >> setUp [ super setUp. prim := AIPrim new. ] -{ #category : #tests } +{ #category : 'tests' } AIPrimTest >> testMinSpanningTreeComplex2 [ | tree graphType graph | @@ -33,7 +35,7 @@ AIPrimTest >> testMinSpanningTreeComplex2 [ equals: 112 ] -{ #category : #tests } +{ #category : 'tests' } AIPrimTest >> testMinimumSpanningTreeComplex [ | tree expectedEdges graphType graph | @@ -55,7 +57,7 @@ AIPrimTest >> testMinimumSpanningTreeComplex [ equals: 9 ] -{ #category : #tests } +{ #category : 'tests' } AIPrimTest >> testMinimumSpanningTreeSimple [ | tree expectedEdges graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AIShortestPathInDAGTest.class.st b/src/AI-Algorithms-Graph-Tests/AIShortestPathInDAGTest.class.st index 3f93881..c1eb049 100644 --- a/src/AI-Algorithms-Graph-Tests/AIShortestPathInDAGTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIShortestPathInDAGTest.class.st @@ -2,22 +2,24 @@ An AIShortestPathInDAGTest is a test class for testing the behavior of AIShortestPathInDAG " Class { - #name : #AIShortestPathInDAGTest, - #superclass : #TestCase, + #name : 'AIShortestPathInDAGTest', + #superclass : 'TestCase', #instVars : [ 'shortestPathAlgo' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIShortestPathInDAGTest >> setUp [ super setUp. shortestPathAlgo := AIShortestPathInDAG new ] -{ #category : #tests } +{ #category : 'tests' } AIShortestPathInDAGTest >> testWeightedDAG [ | shortestPath graphType graph | @@ -54,7 +56,7 @@ AIShortestPathInDAGTest >> testWeightedDAG [ self assert: shortestPath asArray equals: #( ) ] -{ #category : #tests } +{ #category : 'tests' } AIShortestPathInDAGTest >> testWithoutCyclesComplexWeightedGraph [ | shortestPath graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/AITarjanTest.class.st b/src/AI-Algorithms-Graph-Tests/AITarjanTest.class.st index 9fe0d14..1a4440f 100644 --- a/src/AI-Algorithms-Graph-Tests/AITarjanTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AITarjanTest.class.st @@ -1,19 +1,21 @@ Class { - #name : #AITarjanTest, - #superclass : #TestCase, + #name : 'AITarjanTest', + #superclass : 'TestCase', #instVars : [ 'tarjan' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AITarjanTest >> setUp [ super setUp. tarjan := AITarjan new ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testComplexCycle [ | a b c d f e g h graphType graph| @@ -49,7 +51,7 @@ AITarjanTest >> testComplexCycle [ self assertCollection: h cycleNodes hasSameElements: (Array with: g) ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testComplexCycle2 [ | graphType graph| @@ -67,7 +69,7 @@ AITarjanTest >> testComplexCycle2 [ hasSameElements: #( $b $e $d $f ) ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testCycle [ | a b c cycleNodesOfA graphType graph| @@ -87,7 +89,7 @@ AITarjanTest >> testCycle [ self assert: (a cycleNodes includesAll: cycleNodesOfA) ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testNestedCycle [ | a b c cycleNodesOfC d f e g h cycleNodesOfI i graphType graph| @@ -118,7 +120,7 @@ AITarjanTest >> testNestedCycle [ self assert: (i cycleNodes includesAll: cycleNodesOfI) ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testNoCycle [ | graphType graph| @@ -130,7 +132,7 @@ AITarjanTest >> testNoCycle [ tarjan nodes do: [ :n | self deny: n isInCycle ] ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testStronglyConnectedGraph [ | nodeA nodeD nodeF nodeB nodeC nodeE nodeG nodeH graphType graph| @@ -158,7 +160,7 @@ AITarjanTest >> testStronglyConnectedGraph [ nodeH } ] -{ #category : #tests } +{ #category : 'tests' } AITarjanTest >> testStronglyConnectedGraphWithObjects [ | persons nodeA nodeD nodeF nodeB nodeC nodeE nodeG nodeH graphType graph| diff --git a/src/AI-Algorithms-Graph-Tests/AITopologicalSortingTest.class.st b/src/AI-Algorithms-Graph-Tests/AITopologicalSortingTest.class.st index b71e04e..2c22d9f 100644 --- a/src/AI-Algorithms-Graph-Tests/AITopologicalSortingTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AITopologicalSortingTest.class.st @@ -2,21 +2,23 @@ A MalTopologicalSortingTest is a test class for testing the behavior of MalTopologicalSorting " Class { - #name : #AITopologicalSortingTest, - #superclass : #TestCase, + #name : 'AITopologicalSortingTest', + #superclass : 'TestCase', #instVars : [ 'sorter' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AITopologicalSortingTest >> setUp [ super setUp. sorter := AITopologicalSorting new ] -{ #category : #tests } +{ #category : 'tests' } AITopologicalSortingTest >> testSimpleGraph [ | sortedItems graphType graph| @@ -33,7 +35,7 @@ AITopologicalSortingTest >> testSimpleGraph [ self assert: sortedItems asArray equals: #( $a $d $b $c ) ] -{ #category : #tests } +{ #category : 'tests' } AITopologicalSortingTest >> testSortStringHierarchy [ | result topologicalOrder | @@ -52,7 +54,7 @@ AITopologicalSortingTest >> testSortStringHierarchy [ self assertCollection: result equals: topologicalOrder ] -{ #category : #tests } +{ #category : 'tests' } AITopologicalSortingTest >> testSortWithCycle [ | graphType graph| @@ -63,7 +65,7 @@ AITopologicalSortingTest >> testSortWithCycle [ self should: [ sorter run ] raise: Error ] -{ #category : #tests } +{ #category : 'tests' } AITopologicalSortingTest >> testSortWithReducedGraph [ | graphReducer result graphType graph| @@ -85,7 +87,7 @@ AITopologicalSortingTest >> testSortWithReducedGraph [ self assert: (result at: 6) equals: $h ] -{ #category : #tests } +{ #category : 'tests' } AITopologicalSortingTest >> testWithoutCyclesComplexGraph [ | sortedItems graphType graph| @@ -110,7 +112,7 @@ AITopologicalSortingTest >> testWithoutCyclesComplexGraph [ #( $a $b $j $e $g $c $h $k $l $o $q $d $m $n $p $f $i $r $s ) ] -{ #category : #tests } +{ #category : 'tests' } AITopologicalSortingTest >> testWithoutCyclesMediumGraph [ | sortedItems graphType graph| diff --git a/src/AI-Algorithms-Graph-Tests/AIWeightedDAGFixture.class.st b/src/AI-Algorithms-Graph-Tests/AIWeightedDAGFixture.class.st index 61d0a24..7df3c64 100644 --- a/src/AI-Algorithms-Graph-Tests/AIWeightedDAGFixture.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIWeightedDAGFixture.class.st @@ -5,23 +5,25 @@ Graph Class: 3. Directed graphs " Class { - #name : #AIWeightedDAGFixture, - #superclass : #Object, + #name : 'AIWeightedDAGFixture', + #superclass : 'Object', #instVars : [ 'weightedDAG', 'withoutCyclesComplexWeightedGraph' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #initialization } +{ #category : 'initialization' } AIWeightedDAGFixture >> initialize [ super initialize . weightedDAG := self weightedDAG . withoutCyclesComplexWeightedGraph := self withoutCyclesComplexWeightedGraph . ] -{ #category : #fixtures } +{ #category : 'fixtures' } AIWeightedDAGFixture >> weightedDAG [ "https://i.imgur.com/D5zMoQI.png" @@ -37,7 +39,7 @@ AIWeightedDAGFixture >> weightedDAG [ ^graph ] -{ #category : #fixtures } +{ #category : 'fixtures' } AIWeightedDAGFixture >> withoutCyclesComplexWeightedGraph [ "This is a disconnected graph" diff --git a/src/AI-Algorithms-Graph-Tests/AIWeightedHitsTest.class.st b/src/AI-Algorithms-Graph-Tests/AIWeightedHitsTest.class.st index e57ada3..064b788 100644 --- a/src/AI-Algorithms-Graph-Tests/AIWeightedHitsTest.class.st +++ b/src/AI-Algorithms-Graph-Tests/AIWeightedHitsTest.class.st @@ -1,20 +1,22 @@ Class { - #name : #AIWeightedHitsTest, - #superclass : #TestCase, + #name : 'AIWeightedHitsTest', + #superclass : 'TestCase', #instVars : [ 'hits' ], - #category : #'AI-Algorithms-Graph-Tests-Tests' + #category : 'AI-Algorithms-Graph-Tests-Tests', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Tests' } -{ #category : #running } +{ #category : 'running' } AIWeightedHitsTest >> setUp [ super setUp. hits := AIWeightedHits new ] -{ #category : #tests } +{ #category : 'tests' } AIWeightedHitsTest >> testComplexWeighted [ | graphType graph | @@ -32,7 +34,7 @@ AIWeightedHitsTest >> testComplexWeighted [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIWeightedHitsTest >> testComplexWeighted2 [ | graphType graph | @@ -50,7 +52,7 @@ AIWeightedHitsTest >> testComplexWeighted2 [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIWeightedHitsTest >> testComplexWeighted3 [ | graphType graph | @@ -68,7 +70,7 @@ AIWeightedHitsTest >> testComplexWeighted3 [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIWeightedHitsTest >> testSimpleW [ | graphType graph | @@ -86,7 +88,7 @@ AIWeightedHitsTest >> testSimpleW [ self deny: node auth equals: 1 ] ] -{ #category : #tests } +{ #category : 'tests' } AIWeightedHitsTest >> testWithoutCyclesComplexWeightedGraph [ | graphType graph | diff --git a/src/AI-Algorithms-Graph-Tests/DummyTestingPerson.class.st b/src/AI-Algorithms-Graph-Tests/DummyTestingPerson.class.st index 5b14237..a7e56b8 100644 --- a/src/AI-Algorithms-Graph-Tests/DummyTestingPerson.class.st +++ b/src/AI-Algorithms-Graph-Tests/DummyTestingPerson.class.st @@ -2,17 +2,19 @@ I am a class only used by the Tests of graph algorithms. I am used to test if the graph algorithms work well with complex objects as nodes too, not only nodes that are characters. I only provide an array of persons object to test. " Class { - #name : #DummyTestingPerson, - #superclass : #Object, + #name : 'DummyTestingPerson', + #superclass : 'Object', #instVars : [ 'name', 'lastname', 'id' ], - #category : #'AI-Algorithms-Graph-Tests-Fixture' + #category : 'AI-Algorithms-Graph-Tests-Fixture', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Fixture' } -{ #category : #testing } +{ #category : 'testing' } DummyTestingPerson class >> generateNinePersonArray [ | person1 person2 person3 person4 person5 person6 person7 person8 person9 | @@ -28,37 +30,37 @@ DummyTestingPerson class >> generateNinePersonArray [ ^ { person1 . person2 . person3 . person4 . person5 . person6 . person7 . person8 . person9 } ] -{ #category : #accessing } +{ #category : 'accessing' } DummyTestingPerson >> id [ ^ id ] -{ #category : #accessing } +{ #category : 'accessing' } DummyTestingPerson >> id: anObject [ id := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } DummyTestingPerson >> lastname [ ^ lastname ] -{ #category : #accessing } +{ #category : 'accessing' } DummyTestingPerson >> lastname: anObject [ lastname := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } DummyTestingPerson >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } DummyTestingPerson >> name: anObject [ name := anObject diff --git a/src/AI-Algorithms-Graph-Tests/ManifestAIAlgorithmsGraphTests.class.st b/src/AI-Algorithms-Graph-Tests/ManifestAIAlgorithmsGraphTests.class.st index 57593aa..ad9166a 100644 --- a/src/AI-Algorithms-Graph-Tests/ManifestAIAlgorithmsGraphTests.class.st +++ b/src/AI-Algorithms-Graph-Tests/ManifestAIAlgorithmsGraphTests.class.st @@ -2,12 +2,14 @@ Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser " Class { - #name : #ManifestAIAlgorithmsGraphTests, - #superclass : #PackageManifest, - #category : #'AI-Algorithms-Graph-Tests-Manifest' + #name : 'ManifestAIAlgorithmsGraphTests', + #superclass : 'PackageManifest', + #category : 'AI-Algorithms-Graph-Tests-Manifest', + #package : 'AI-Algorithms-Graph-Tests', + #tag : 'Manifest' } -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestAIAlgorithmsGraphTests class >> ruleLiteralArrayCharactersRuleV1FalsePositive [ ^ #(#(#(#RGPackageDefinition #(#'AI-Algorithms-Graph-Tests')) #'2021-08-13T22:27:18.883059+02:00') ) ] diff --git a/src/AI-Algorithms-Graph-Tests/package.st b/src/AI-Algorithms-Graph-Tests/package.st index a883d97..3a11ce6 100644 --- a/src/AI-Algorithms-Graph-Tests/package.st +++ b/src/AI-Algorithms-Graph-Tests/package.st @@ -1 +1 @@ -Package { #name : #'AI-Algorithms-Graph-Tests' } +Package { #name : 'AI-Algorithms-Graph-Tests' }