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 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. 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.