Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions .github/workflows/Pharo11CI.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
name: 'Pharo 11 CI'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
push:
branches:
- 'main'
pull_request:
types: [assigned, opened, synchronize, reopened]

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
smalltalk: [ Pharo64-11 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load in New Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }} ${{ matrix.ston }}
shell: bash
timeout-minutes: 15
name: 'CI'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
push:
branches:
- 'main'
pull_request:
types: [assigned, opened, synchronize, reopened]

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
smalltalk: [ Pharo64-11, Pharo64-12, Pharo64-13 ]
ston: [ .smalltalkci.default.ston ]
runs-on: ${{ matrix.os }}
name: >
${{ matrix.smalltalk }} • ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}

- name: Run ${{ matrix.ston == '.smalltalkci.default.ston' && 'Full' || 'Core' }} tests
run: smalltalkci -s ${{ matrix.smalltalk }} ${{ matrix.ston }}
shell: bash
timeout-minutes: 30
29 changes: 0 additions & 29 deletions .github/workflows/Pharo12CI.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ SmalltalkCISpec {
SCIMetacelloLoadSpec {
#baseline : 'Pyramid',
#directory : 'src',
#onConflict : #useLoaded,
#onUpgrade : #useLoaded,
#onWarningLog : true,
#platforms : [ #pharo ]
}
],
Expand Down
19 changes: 19 additions & 0 deletions .smalltalkci.default.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SmalltalkCISpec {

#preLoading: '.github/ci/preLoading.st',

#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Pyramid',
#directory : 'src',
#onConflict : #useLoaded,
#onUpgrade : #useLoaded,
#onWarningLog : true,
#platforms : [ #pharo ]
}
],
#testing : {
#categories : [ 'Pyramid*' ],
#packages : [ 'Bloc-Serialization.*' ]
}
}
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[![License](https://img.shields.io/github/license/openSmock/Pyramid.svg)](./LICENSE)
[![Pharo 11 CI](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo11CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo11CI.yml)
[![Pharo 12 CI](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo12CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo12CI.yml)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 12](https://img.shields.io/badge/Pharo-12-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 13](https://img.shields.io/badge/Pharo-13-%23aac9ff.svg)](https://pharo.org/download)

[![License](https://img.shields.io/github/license/OpenSmock/Pyramid.svg)](./LICENSE)
[![Unit tests](https://github.com/OpenSmock/Pyramid/actions/workflows/CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/CI.yml)

# Pyramid

Expand Down Expand Up @@ -59,7 +62,7 @@ We advise you to use dependencies committed at the date of the Pyramid release (
```st
Metacello new
baseline: 'Pyramid';
repository: 'github://OpenSmock/Pyramid:alpha4';
repository: 'github://OpenSmock/Pyramid:alpha7';
load
```

Expand Down
6 changes: 3 additions & 3 deletions src/Pyramid-Bloc/PyramidElementsManipulationHelper.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ PyramidElementsManipulationHelper class >> accumulateParentsOf: aCollectionOfBlE
nextCollection := OrderedCollection new.

onCollection do: [ :each |
(each hasParent: elementToTest) ifFalse: [
(each allParentsInclude: elementToTest) ifFalse: [
nextCollection add: each ].
(shouldKeepIt and: [ elementToTest hasParent: each ]) ifTrue: [
shouldKeepIt := false ] ].
(shouldKeepIt and: [ elementToTest allParentsInclude: each ])
ifTrue: [ shouldKeepIt := false ] ].
shouldKeepIt ifTrue: [ result add: elementToTest ].
self accumulateParentsOf: nextCollection in: result
]
Expand Down
68 changes: 60 additions & 8 deletions src/Pyramid-Tests/PyramidLayoutBlocCommandTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,78 @@ PyramidLayoutBlocCommandTest >> command [

{ #category : #'as yet unclassified' }
PyramidLayoutBlocCommandTest >> targetContainers [

| flowLayoutVertical basicLayout proportionalLayout |

flowLayoutVertical := BlFlowLayout vertical.
basicLayout := BlBasicLayout new.
proportionalLayout := BlProportionalLayout new.

^ {
(PyramidCommandTestContainer
no: BlElement new
with: (BlElement new
layout: BlFlowLayout vertical;
layout: flowLayoutVertical;
yourself)
prop: BlFlowLayout vertical).
prop: flowLayoutVertical).
(PyramidCommandTestContainer
no: (BlElement new
layout: BlFlowLayout vertical;
layout: flowLayoutVertical;
yourself)
with: (BlElement new
layout: BlBasicLayout new;
layout: basicLayout;
yourself)
prop: BlBasicLayout new).
prop: basicLayout).
(PyramidCommandTestContainer
no: BlElement new
with: (BlElement new
layout: BlProportionalLayout new;
layout: proportionalLayout;
yourself)
prop: BlProportionalLayout new) }
prop: proportionalLayout) }
]

{ #category : #tests }
PyramidLayoutBlocCommandTest >> testHistory [
"Do once.
undo
redo
undo
redo"

| history commandExecutor targets |
targets := self targetsCanBeUsedFor.
history := PyramidHistory new.
commandExecutor := PyramidHistoryCommandExecutor new
history: history;
wrappee: PyramidMainCommandExecutor new;
yourself.

"Do once"
self argumentsForHistory do: [ :each |
commandExecutor use: self command on: targets with: each ].

"Undo all"
self argumentsForHistory reverseDo: [ :argument |
targets do: [ :target |
self
assert: (self command getValueFor: target) class
equals: argument class ].
history canUndo ifTrue: [ history undo ] ].

"Redo all"
self argumentsForHistory do: [ :argument |
history canRedo ifTrue: [ history redo ].
targets do: [ :target |
self assert: (self command getValueFor: target) class equals: argument class] ].

"Undo all"
self argumentsForHistory reverseDo: [ :argument |
targets do: [ :target |
self assert: (self command getValueFor: target) class equals: argument class].
history canUndo ifTrue: [ history undo ] ].

"Redo all"
self argumentsForHistory do: [ :argument |
history canRedo ifTrue: [ history redo ].
targets do: [ :target |
self assert: (self command getValueFor: target) class equals: argument class ] ]
]
Loading