#BUGFIX by Stefan Reise
class: RegressionTests::MutabilityTest
changed:
#test01_immutability
#test02_mutability
--- a/RegressionTests__MutabilityTest.st Sat Jun 15 09:45:43 2019 +0200
+++ b/RegressionTests__MutabilityTest.st Mon Jun 17 15:11:33 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"{ Package: 'stx:goodies/regression' }"
"{ NameSpace: RegressionTests }"
@@ -51,13 +49,12 @@
test01_immutability
"literals are immutable - if specified so"
+
+ <pragma: +STXExtendedArrayLiterals>
+ <pragma: +arraysAreImmutable>
|arr arr2|
- self skipIf:(self class compiledMethodAt:#test01_immutability)
- byteCode isNil
- description:'skipped because stc-compiled literals are always immutable'.
-
arr := #[1 2 3 4].
self assert:(arr isImmutable). "/ because it comes from a literal
self should:[arr at:1 put:10] raise:NoModificationError.
@@ -85,7 +82,7 @@
self shouldnt:[arr2 at:1 put:10] raise:Error.
"/ unboxed s32
- "/ arr := #s32(1 2 3 4).
+ arr := #s32(1 2 3 4).
self assert:(arr isImmutable). "/ because it comes from a literal
self should:[arr at:1 put:10] raise:NoModificationError.
@@ -149,7 +146,7 @@
self shouldnt:[arr2 at:1 put:10] raise:Error.
"/ unboxed f16
- "/arr := #f16(1 2 3 4).
+ arr := #f16(1 2 3 4).
self assert:(arr isImmutable). "/ because it comes from a literal
self should:[arr at:1 put:10] raise:NoModificationError.
@@ -158,7 +155,7 @@
self shouldnt:[arr2 at:1 put:10] raise:Error.
"/ unboxed f32
- "/arr := #f32(1 2 3 4).
+ arr := #f32(1 2 3 4).
self assert:(arr isImmutable). "/ because it comes from a literal
self should:[arr at:1 put:10] raise:NoModificationError.
@@ -167,7 +164,7 @@
self shouldnt:[arr2 at:1 put:10] raise:Error.
"/ unboxed f64
- "/arr := #f64(1 2 3 4).
+ arr := #f64(1 2 3 4).
self assert:(arr isImmutable). "/ because it comes from a literal
self should:[arr at:1 put:10] raise:NoModificationError.
@@ -182,76 +179,83 @@
"Created: / 09-06-2019 / 15:49:37 / Claus Gittinger"
"Modified: / 10-06-2019 / 20:50:21 / Claus Gittinger"
+ "Modified: / 17-06-2019 / 15:11:09 / Stefan Reise"
!
test02_mutability
"literals are mutable - if specified so"
+ <pragma: +STXExtendedArrayLiterals>
+ <pragma: -arraysAreImmutable>
|arr|
- "/ arr := #[1 2 3 4].
+ self skipIf:(self class compiledMethodAt:#test01_immutability)
+ byteCode isNil
+ description:'skipped because stc-compiled literals are always immutable'.
+
+ arr := #[1 2 3 4].
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed s8
- "/ arr := #s8(1 2 3 4).
+ arr := #s8(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed s16
- "/arr := #s16(1 2 3 4).
+ arr := #s16(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed s32
- "/arr := #s32(1 2 3 4).
+ arr := #s32(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed s64
- "/ arr := #s64(1 2 3 4).
+ arr := #s64(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed u1
- "/arr := #u1(0 1 1 0).
+ arr := #u1(0 1 1 0).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:1] raise:NoModificationError.
self should:[arr at:1 put:2] raise:Error.
"/ unboxed u8
- "/arr := #u8(1 2 3 4).
+ arr := #u8(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed u16
- "/arr := #u16(1 2 3 4).
+ arr := #u16(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed u32
- "/arr := #u32(1 2 3 4).
+ arr := #u32(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed u64
- "/arr := #s64(1 2 3 4).
+ arr := #s64(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed f16
- "/ arr := #f16(1 2 3 4).
+ arr := #f16(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed f32
- "/arr := #f32(1 2 3 4).
+ arr := #f32(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
"/ unboxed f64
- "/arr := #f64(1 2 3 4).
+ arr := #f64(1 2 3 4).
self assert:(arr isImmutable not). "/ because I specifid so
self shouldnt:[arr at:1 put:10] raise:NoModificationError.
@@ -261,10 +265,12 @@
"
"Created: / 09-06-2019 / 15:49:46 / Claus Gittinger"
+ "Modified: / 17-06-2019 / 15:11:06 / Stefan Reise"
! !
!MutabilityTest class methodsFor:'documentation'!
version_CVS
^ '$Header$'
-! !
\ No newline at end of file
+! !
+