-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbc45f4
commit 28a6d8a
Showing
17 changed files
with
732 additions
and
732 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
repository/BaselineOfOpenPonkSynchronizedLinks/BaselineOfOpenPonkSynchronizedLinks.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
" | ||
Baseline for https://github.com/OpenPonk/synchronized-links | ||
" | ||
Class { | ||
#name : 'BaselineOfOpenPonkSynchronizedLinks', | ||
#superclass : 'BaselineOf', | ||
#category : 'BaselineOfOpenPonkSynchronizedLinks', | ||
#package : 'BaselineOfOpenPonkSynchronizedLinks' | ||
} | ||
|
||
{ #category : 'baselines' } | ||
BaselineOfOpenPonkSynchronizedLinks >> baseline: spec [ | ||
<baseline> | ||
spec | ||
for: #common | ||
do: [ spec package: 'OpenPonk-SynchronizedLinks'. | ||
spec group: 'default' with: #('OpenPonk-SynchronizedLinks') ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : 'BaselineOfOpenPonkSynchronizedLinks' } |
18 changes: 0 additions & 18 deletions
18
repository/BaselineOfSynchronizedLinks/BaselineOfSynchronizedLinks.class.st
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
162 changes: 81 additions & 81 deletions
162
...ks/SRManyToManyLinkInterfaceTest.class.st → ...ks/SRManyToManyLinkInterfaceTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
Class { | ||
#name : 'SRManyToManyLinkInterfaceTest', | ||
#superclass : 'TestCase', | ||
#instVars : [ | ||
'a1', | ||
'b1', | ||
'b2' | ||
], | ||
#category : 'SynchronizedLinks-Tests', | ||
#package : 'SynchronizedLinks', | ||
#tag : 'Tests' | ||
} | ||
|
||
{ #category : 'initialization' } | ||
SRManyToManyLinkInterfaceTest >> setUp [ | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
b2 := SRTestBook new. | ||
a1 books add: b1. | ||
a1 books add: b2 | ||
] | ||
|
||
{ #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' } | ||
SRManyToManyLinkInterfaceTest >> testAtLast [ | ||
self assert: (a1 books atLast: 2) equals: a1 books first. | ||
self assert: (a1 books atLast: 1) equals: a1 books second | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testCopy [ | ||
| books copy | | ||
books := a1 books. | ||
copy := books copy. | ||
self assert: books size equals: 2. | ||
self assert: copy size equals: 2. | ||
copy remove: copy first. | ||
self assert: books size equals: 2. | ||
self assert: copy size equals: 1. | ||
copy remove: copy first. | ||
self assert: books size equals: 2. | ||
self assert: copy size equals: 0 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testCopyEmpty [ | ||
| empty | | ||
empty := a1 books copyEmpty. | ||
self assert: empty isEmpty. | ||
self assert: empty species equals: a1 books species | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testFirst [ | ||
self assert: a1 books first equals: b1 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testLast [ | ||
self assert: a1 books last equals: b2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testLastN [ | ||
self assert: (a1 books last: 2) asArray equals: (Array with: b1 with: b2) | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testSecond [ | ||
self assert: a1 books second equals: b2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testSpecies [ | ||
self assert: a1 books species equals: OrderedCollection | ||
] | ||
Class { | ||
#name : 'SRManyToManyLinkInterfaceTest', | ||
#superclass : 'TestCase', | ||
#instVars : [ | ||
'a1', | ||
'b1', | ||
'b2' | ||
], | ||
#category : 'OpenPonk-SynchronizedLinks-Tests', | ||
#package : 'OpenPonk-SynchronizedLinks', | ||
#tag : 'Tests' | ||
} | ||
|
||
{ #category : 'initialization' } | ||
SRManyToManyLinkInterfaceTest >> setUp [ | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
b2 := SRTestBook new. | ||
a1 books add: b1. | ||
a1 books add: b2 | ||
] | ||
|
||
{ #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' } | ||
SRManyToManyLinkInterfaceTest >> testAtLast [ | ||
self assert: (a1 books atLast: 2) equals: a1 books first. | ||
self assert: (a1 books atLast: 1) equals: a1 books second | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testCopy [ | ||
| books copy | | ||
books := a1 books. | ||
copy := books copy. | ||
self assert: books size equals: 2. | ||
self assert: copy size equals: 2. | ||
copy remove: copy first. | ||
self assert: books size equals: 2. | ||
self assert: copy size equals: 1. | ||
copy remove: copy first. | ||
self assert: books size equals: 2. | ||
self assert: copy size equals: 0 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testCopyEmpty [ | ||
| empty | | ||
empty := a1 books copyEmpty. | ||
self assert: empty isEmpty. | ||
self assert: empty species equals: a1 books species | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testFirst [ | ||
self assert: a1 books first equals: b1 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testLast [ | ||
self assert: a1 books last equals: b2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testLastN [ | ||
self assert: (a1 books last: 2) asArray equals: (Array with: b1 with: b2) | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testSecond [ | ||
self assert: a1 books second equals: b2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkInterfaceTest >> testSpecies [ | ||
self assert: a1 books species equals: OrderedCollection | ||
] |
184 changes: 92 additions & 92 deletions
184
...onizedLinks/SRManyToManyLinkTest.class.st → ...onizedLinks/SRManyToManyLinkTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
Class { | ||
#name : 'SRManyToManyLinkTest', | ||
#superclass : 'TestCase', | ||
#category : 'SynchronizedLinks-Tests', | ||
#package : 'SynchronizedLinks', | ||
#tag : 'Tests' | ||
} | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testChangePair [ | ||
| a1 b1 a2 b2 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
a2 := SRTestAuthor new. | ||
b2 := SRTestBook new. | ||
a2 books add: b2. | ||
a2 books add: b1. | ||
self assert: a1 books asArray equals: {b1}. | ||
self assert: a2 books asArray equals: (Array with: b2 with: b1). | ||
self assert: b1 authors asArray equals: (Array with: a1 with: a2). | ||
self assert: b2 authors asArray equals: {a2} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testFromCollection [ | ||
| a1 b1 b2 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
b2 := SRTestBook new. | ||
a1 books: {b2}. | ||
self assert: a1 books asArray equals: {b2}. | ||
self assert: b2 authors asArray equals: {a1}. | ||
self assert: b1 authors asArray equals: {} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testFromCollectionMultiple [ | ||
| b1 a1 a2 | | ||
b1 := SRTestBook new. | ||
a1 := SRTestAuthor new. | ||
a2 := SRTestAuthor new. | ||
b1 authors: (Array with: a1 with: a2). | ||
self assert: b1 authors asArray equals: (Array with: a1 with: a2). | ||
self assert: a1 books asArray equals: {b1}. | ||
self assert: a2 books asArray equals: {b1}. | ||
b1 authors: {}. | ||
self assert: b1 authors asArray equals: {}. | ||
self assert: a1 books asArray equals: {}. | ||
self assert: a2 books asArray equals: {} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testFromNone [ | ||
| a1 b1 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
self assert: a1 books asArray equals: {b1}. | ||
self assert: b1 authors asArray equals: {a1} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testSton [ | ||
| author b1 b2 ston materializedA2 | | ||
author := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
b2 := SRTestBook new. | ||
author books add: b1. | ||
author books add: b2. | ||
ston := STON toStringPretty: author. | ||
materializedA2 := STON fromString: ston. | ||
self assertCollection: materializedA2 books size equals: 2. | ||
self | ||
assertCollection: materializedA2 books first authors size | ||
equals: 1. | ||
self | ||
assertCollection: materializedA2 books first authors first | ||
equals: materializedA2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testToNone [ | ||
| a1 b1 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
a1 books remove: b1. | ||
self assert: a1 books asArray equals: {}. | ||
self assert: b1 authors asArray equals: {} | ||
] | ||
Class { | ||
#name : 'SRManyToManyLinkTest', | ||
#superclass : 'TestCase', | ||
#category : 'OpenPonk-SynchronizedLinks-Tests', | ||
#package : 'OpenPonk-SynchronizedLinks', | ||
#tag : 'Tests' | ||
} | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testChangePair [ | ||
| a1 b1 a2 b2 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
a2 := SRTestAuthor new. | ||
b2 := SRTestBook new. | ||
a2 books add: b2. | ||
a2 books add: b1. | ||
self assert: a1 books asArray equals: {b1}. | ||
self assert: a2 books asArray equals: (Array with: b2 with: b1). | ||
self assert: b1 authors asArray equals: (Array with: a1 with: a2). | ||
self assert: b2 authors asArray equals: {a2} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testFromCollection [ | ||
| a1 b1 b2 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
b2 := SRTestBook new. | ||
a1 books: {b2}. | ||
self assert: a1 books asArray equals: {b2}. | ||
self assert: b2 authors asArray equals: {a1}. | ||
self assert: b1 authors asArray equals: {} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testFromCollectionMultiple [ | ||
| b1 a1 a2 | | ||
b1 := SRTestBook new. | ||
a1 := SRTestAuthor new. | ||
a2 := SRTestAuthor new. | ||
b1 authors: (Array with: a1 with: a2). | ||
self assert: b1 authors asArray equals: (Array with: a1 with: a2). | ||
self assert: a1 books asArray equals: {b1}. | ||
self assert: a2 books asArray equals: {b1}. | ||
b1 authors: {}. | ||
self assert: b1 authors asArray equals: {}. | ||
self assert: a1 books asArray equals: {}. | ||
self assert: a2 books asArray equals: {} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testFromNone [ | ||
| a1 b1 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
self assert: a1 books asArray equals: {b1}. | ||
self assert: b1 authors asArray equals: {a1} | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testSton [ | ||
| author b1 b2 ston materializedA2 | | ||
author := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
b2 := SRTestBook new. | ||
author books add: b1. | ||
author books add: b2. | ||
ston := STON toStringPretty: author. | ||
materializedA2 := STON fromString: ston. | ||
self assertCollection: materializedA2 books size equals: 2. | ||
self | ||
assertCollection: materializedA2 books first authors size | ||
equals: 1. | ||
self | ||
assertCollection: materializedA2 books first authors first | ||
equals: materializedA2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
SRManyToManyLinkTest >> testToNone [ | ||
| a1 b1 | | ||
a1 := SRTestAuthor new. | ||
b1 := SRTestBook new. | ||
a1 books add: b1. | ||
a1 books remove: b1. | ||
self assert: a1 books asArray equals: {}. | ||
self assert: b1 authors asArray equals: {} | ||
] |
Oops, something went wrong.