From 5918b334d89d77090d790f69185bc2c9d89d5218 Mon Sep 17 00:00:00 2001 From: Brendan Date: Fri, 9 Oct 2026 11:00:01 +0200 Subject: [PATCH 1/3] Fix serialization of state checked for SwitchIcon + Add tests --- .../ToSwitchIcon.extension.st | 7 +++ .../ToSerializerTest.class.st | 51 ++++++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/Toplo-Serialization-Stash/ToSwitchIcon.extension.st diff --git a/src/Toplo-Serialization-Stash/ToSwitchIcon.extension.st b/src/Toplo-Serialization-Stash/ToSwitchIcon.extension.st new file mode 100644 index 0000000..b9614dc --- /dev/null +++ b/src/Toplo-Serialization-Stash/ToSwitchIcon.extension.st @@ -0,0 +1,7 @@ +Extension { #name : #ToSwitchIcon } + +{ #category : #'*Toplo-Serialization-Stash' } +ToSwitchIcon >> stashChecked [ + + ^ { ([ :e | 'checked: ' , self checked printString ] -> self) onlySetOnStash } +] diff --git a/src/Toplo-Serialization-Tests/ToSerializerTest.class.st b/src/Toplo-Serialization-Tests/ToSerializerTest.class.st index f84767b..4df251d 100644 --- a/src/Toplo-Serialization-Tests/ToSerializerTest.class.st +++ b/src/Toplo-Serialization-Tests/ToSerializerTest.class.st @@ -552,6 +552,55 @@ ToSerializerTest >> testToRadioButton4 [ self test: origin on: [ :element | self assert: element isCheckable ] ] +{ #category : #tests } +ToSerializerTest >> testToSwitchButton1 [ + + | origin | + origin := ToSwitchButton new + labelText: 'hello'; + yourself. + + self test: origin on: [ :element | + self assert: element labelText asString equals: 'hello'] +] + +{ #category : #tests } +ToSerializerTest >> testToSwitchButton2 [ + + | origin | + origin := ToSwitchButton new. + + self test: origin on: [ :element | + self assert: element label equals: nil. + self deny: element icon equals: nil ] + +] + +{ #category : #tests } +ToSerializerTest >> testToSwitchButton3 [ + + | origin | + origin := ToSwitchButton new + checked:true; + yourself. + + self assert: origin icon isChecked. + + self test: origin on: [ :element | + self assert: element label equals: nil. + self assert: element icon isChecked ] +] + +{ #category : #tests } +ToSerializerTest >> testToSwitchButton4 [ + + | origin | + origin := ToSwitchButton new. + + self test: origin on: [ :element | + self assert: element isCheckable ] +] + { #category : #tests } ToSerializerTest >> testToTextFieldPlaceholder [ @@ -596,7 +645,7 @@ ToSerializerTest >> testToToggleButton1 [ ToSerializerTest >> testToToggleButton2 [ | origin | - origin := ToButton new. + origin := ToToggleButton new. self test: origin on: [ :element | self assert: element label equals: nil. From 0608facf5f1fd2a89bd100b92b6f2614b639a104 Mon Sep 17 00:00:00 2001 From: LANDAIS Brendan <116742582+LANDAISB@users.noreply.github.com> Date: Fri, 9 Oct 2026 11:35:55 +0200 Subject: [PATCH 2/3] Update CI.yml --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 03f3cd4..3ce0526 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - smalltalk: [ Pharo64-11, Pharo64-12, Pharo64-13, Pharo64-14 ] + smalltalk: [ Pharo64-12, Pharo64-13, Pharo64-14 ] ston: [ .smalltalkci.default.ston ] runs-on: ${{ matrix.os }} name: > @@ -30,4 +30,4 @@ jobs: - name: Run ${{ matrix.ston == '.smalltalkci.default.ston' }} tests run: smalltalkci -s ${{ matrix.smalltalk }} ${{ matrix.ston }} shell: bash - timeout-minutes: 30 \ No newline at end of file + timeout-minutes: 30 From b8589644ce290f6eb848e76da20454d22e171be7 Mon Sep 17 00:00:00 2001 From: LANDAIS Brendan <116742582+LANDAISB@users.noreply.github.com> Date: Fri, 9 Oct 2026 11:55:48 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f22f41..c686e20 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![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) [![Pharo 14](https://img.shields.io/badge/Pharo-14-%23aac9ff.svg)](https://pharo.org/download) @@ -30,4 +29,4 @@ Metacello new ## License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \ No newline at end of file +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.