Skip to content

Commit

Permalink
Moved to Tonel 3
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Jun 18, 2024
1 parent d628075 commit cbc45f4
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
Baseline for https://github.com/OpenPonk/synchronized-links
"
Class {
#name : #BaselineOfSynchronizedLinks,
#superclass : #BaselineOf,
#category : 'BaselineOfSynchronizedLinks'
#name : 'BaselineOfSynchronizedLinks',
#superclass : 'BaselineOf',
#category : 'BaselineOfSynchronizedLinks',
#package : 'BaselineOfSynchronizedLinks'
}

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfSynchronizedLinks >> baseline: spec [
<baseline>
spec
Expand Down
2 changes: 1 addition & 1 deletion repository/BaselineOfSynchronizedLinks/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfSynchronizedLinks }
Package { #name : 'BaselineOfSynchronizedLinks' }
28 changes: 15 additions & 13 deletions repository/SynchronizedLinks/SRManyToManyLinkInterfaceTest.class.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Class {
#name : #SRManyToManyLinkInterfaceTest,
#superclass : #TestCase,
#name : 'SRManyToManyLinkInterfaceTest',
#superclass : 'TestCase',
#instVars : [
'a1',
'b1',
'b2'
],
#category : 'SynchronizedLinks-Tests'
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #initialization }
{ #category : 'initialization' }
SRManyToManyLinkInterfaceTest >> setUp [
a1 := SRTestAuthor new.
b1 := SRTestBook new.
Expand All @@ -18,19 +20,19 @@ SRManyToManyLinkInterfaceTest >> setUp [
a1 books add: b2
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testAt [
self assert: (a1 books at: 1) equals: a1 books first.
self assert: (a1 books at: 2) equals: a1 books second
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testAtLast [
self assert: (a1 books atLast: 2) equals: a1 books first.
self assert: (a1 books atLast: 1) equals: a1 books second
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testCopy [
| books copy |
books := a1 books.
Expand All @@ -45,35 +47,35 @@ SRManyToManyLinkInterfaceTest >> testCopy [
self assert: copy size equals: 0
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testCopyEmpty [
| empty |
empty := a1 books copyEmpty.
self assert: empty isEmpty.
self assert: empty species equals: a1 books species
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testFirst [
self assert: a1 books first equals: b1
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testLast [
self assert: a1 books last equals: b2
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testLastN [
self assert: (a1 books last: 2) asArray equals: (Array with: b1 with: b2)
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testSecond [
self assert: a1 books second equals: b2
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkInterfaceTest >> testSpecies [
self assert: a1 books species equals: OrderedCollection
]
20 changes: 11 additions & 9 deletions repository/SynchronizedLinks/SRManyToManyLinkTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #SRManyToManyLinkTest,
#superclass : #TestCase,
#category : #'SynchronizedLinks-Tests'
#name : 'SRManyToManyLinkTest',
#superclass : 'TestCase',
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkTest >> testChangePair [
| a1 b1 a2 b2 |
a1 := SRTestAuthor new.
Expand All @@ -20,7 +22,7 @@ SRManyToManyLinkTest >> testChangePair [
self assert: b2 authors asArray equals: {a2}
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkTest >> testFromCollection [
| a1 b1 b2 |
a1 := SRTestAuthor new.
Expand All @@ -33,7 +35,7 @@ SRManyToManyLinkTest >> testFromCollection [
self assert: b1 authors asArray equals: {}
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkTest >> testFromCollectionMultiple [
| b1 a1 a2 |
b1 := SRTestBook new.
Expand All @@ -49,7 +51,7 @@ SRManyToManyLinkTest >> testFromCollectionMultiple [
self assert: a2 books asArray equals: {}
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkTest >> testFromNone [
| a1 b1 |
a1 := SRTestAuthor new.
Expand All @@ -59,7 +61,7 @@ SRManyToManyLinkTest >> testFromNone [
self assert: b1 authors asArray equals: {a1}
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkTest >> testSton [
| author b1 b2 ston materializedA2 |
author := SRTestAuthor new.
Expand All @@ -78,7 +80,7 @@ SRManyToManyLinkTest >> testSton [
equals: materializedA2
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToManyLinkTest >> testToNone [
| a1 b1 |
a1 := SRTestAuthor new.
Expand Down
16 changes: 9 additions & 7 deletions repository/SynchronizedLinks/SRManyToOneLinkTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #SRManyToOneLinkTest,
#superclass : #TestCase,
#category : 'SynchronizedLinks-Tests'
#name : 'SRManyToOneLinkTest',
#superclass : 'TestCase',
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #tests }
{ #category : 'tests' }
SRManyToOneLinkTest >> testChangePair [
| r1 b1 r2 b2 |
r1 := SRTestReview new.
Expand All @@ -20,7 +22,7 @@ SRManyToOneLinkTest >> testChangePair [
self assert: b1 reviews asArray equals: {}
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToOneLinkTest >> testFromCollection [
| r1 b1 r2 |
b1 := SRTestBook new.
Expand All @@ -33,7 +35,7 @@ SRManyToOneLinkTest >> testFromCollection [
self assert: r1 book equals: nil
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToOneLinkTest >> testFromNone [
| r1 b1 |
r1 := SRTestReview new.
Expand All @@ -43,7 +45,7 @@ SRManyToOneLinkTest >> testFromNone [
self assert: r1 book equals: b1
]

{ #category : #tests }
{ #category : 'tests' }
SRManyToOneLinkTest >> testToNone [
| r1 b1 |
r1 := SRTestReview new.
Expand Down
14 changes: 8 additions & 6 deletions repository/SynchronizedLinks/SROneToManyLinkTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #SROneToManyLinkTest,
#superclass : #TestCase,
#category : 'SynchronizedLinks-Tests'
#name : 'SROneToManyLinkTest',
#superclass : 'TestCase',
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #tests }
{ #category : 'tests' }
SROneToManyLinkTest >> testChangePair [
| r1 b1 r2 b2 |
r1 := SRTestReview new.
Expand All @@ -20,7 +22,7 @@ SROneToManyLinkTest >> testChangePair [
self assert: b1 reviews asArray equals: {}
]

{ #category : #tests }
{ #category : 'tests' }
SROneToManyLinkTest >> testFromNone [
| r1 b1 |
r1 := SRTestReview new.
Expand All @@ -30,7 +32,7 @@ SROneToManyLinkTest >> testFromNone [
self assert: b1 reviews asArray equals: {r1}
]

{ #category : #tests }
{ #category : 'tests' }
SROneToManyLinkTest >> testToNone [
| r1 b1 |
r1 := SRTestReview new.
Expand Down
16 changes: 9 additions & 7 deletions repository/SynchronizedLinks/SROneToOneLinkTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #SROneToOneLinkTest,
#superclass : #TestCase,
#category : 'SynchronizedLinks-Tests'
#name : 'SROneToOneLinkTest',
#superclass : 'TestCase',
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #tests }
{ #category : 'tests' }
SROneToOneLinkTest >> testBothFromNil [
| r1 s1 |
r1 := SRTestReview new.
Expand All @@ -14,7 +16,7 @@ SROneToOneLinkTest >> testBothFromNil [
self assert: r1 score equals: s1
]

{ #category : #tests }
{ #category : 'tests' }
SROneToOneLinkTest >> testChangePair [
| r1 s1 r2 s2 |
r1 := SRTestReview new.
Expand All @@ -30,7 +32,7 @@ SROneToOneLinkTest >> testChangePair [
self assert: s2 review equals: nil
]

{ #category : #tests }
{ #category : 'tests' }
SROneToOneLinkTest >> testNothingChanged [
| r1 s1 |
r1 := SRTestReview new.
Expand All @@ -43,7 +45,7 @@ SROneToOneLinkTest >> testNothingChanged [
self assert: r1 score equals: s1
]

{ #category : #tests }
{ #category : 'tests' }
SROneToOneLinkTest >> testToNil [
| r1 s1 |
r1 := SRTestReview new.
Expand Down
12 changes: 7 additions & 5 deletions repository/SynchronizedLinks/SRTestAuthor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
author -> books: N:M
"
Class {
#name : #SRTestAuthor,
#superclass : #Object,
#name : 'SRTestAuthor',
#superclass : 'Object',
#instVars : [
'books'
],
#category : 'SynchronizedLinks-Tests'
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #accessing }
{ #category : 'accessing' }
SRTestAuthor >> books [
^ books
ifNil: [ books := SRToManyLink
Expand All @@ -19,7 +21,7 @@ SRTestAuthor >> books [
oppositeSlot: #authors ]
]

{ #category : #accessing }
{ #category : 'accessing' }
SRTestAuthor >> books: aCollection [
self books
removeAll;
Expand Down
16 changes: 9 additions & 7 deletions repository/SynchronizedLinks/SRTestBook.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ books -> authors: N:M
book -> reviews: 1:N
"
Class {
#name : #SRTestBook,
#superclass : #Object,
#name : 'SRTestBook',
#superclass : 'Object',
#instVars : [
'authors',
'reviews'
],
#category : 'SynchronizedLinks-Tests'
#category : 'SynchronizedLinks-Tests',
#package : 'SynchronizedLinks',
#tag : 'Tests'
}

{ #category : #accessing }
{ #category : 'accessing' }
SRTestBook >> authors [
^ authors
ifNil: [ authors := SRToManyLink
Expand All @@ -21,14 +23,14 @@ SRTestBook >> authors [
oppositeSlot: #books ]
]

{ #category : #accessing }
{ #category : 'accessing' }
SRTestBook >> authors: aCollection [
self authors
removeAll;
addAll: aCollection
]

{ #category : #accessing }
{ #category : 'accessing' }
SRTestBook >> reviews [
^ reviews
ifNil: [ reviews := SRToManyLink
Expand All @@ -37,7 +39,7 @@ SRTestBook >> reviews [
oppositeSlot: #book ]
]

{ #category : #accessing }
{ #category : 'accessing' }
SRTestBook >> reviews: aCollection [
self reviews
removeAll;
Expand Down
Loading

0 comments on commit cbc45f4

Please sign in to comment.