class: RegressionTests::ChangeSetTests
added: #test_misc_package_01b
comment/format in: #test_misc_package_01a
--- a/RegressionTests__ChangeSetTests.st Thu Jul 16 17:52:12 2015 +0200
+++ b/RegressionTests__ChangeSetTests.st Mon Jul 20 18:19:45 2015 +0200
@@ -2243,11 +2243,15 @@
!ChangeSetTests methodsFor:'tests - misc'!
test_misc_package_01a
- "
- When reading session changefile, make sure that change's package is
- not the one of by-chance-last package pragma in the stream.
- "
+ "When reading session changefile, make sure that change's package is
+ not the one of by-chance-last package pragma in the stream.
+
+ SV: it is not exactly clear, whether this is a bug or a feature.
+ There may be changefiles, that have the package or namespace definition in a
+ seaprate chunk - see ChangeSet>>#changesFromStream:for:reader:do - line 70"
+
| cs |
+
cs := ChangeSet fromStream:'"{ Encoding: utf8 }" !!
''---- timestamp jv@sao 05-10-2013 01:57:54 ----''!!
"{ Package: ''some:funny/package'' }"
@@ -2274,6 +2278,40 @@
"Created: / 05-08-2014 / 10:49:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+test_misc_package_01b
+ "When reading session changefile, make sure that change's package is
+ honored when present in a own chunk.
+
+ SV: this contradicts with #test_misc_package_01a - see ChangeSet>>#changesFromStream:for:reader:do - line 70"
+
+ | cs |
+
+ cs := ChangeSet fromStream:'"{ Encoding: utf8 }" !!
+''---- timestamp jv@sao 05-10-2013 01:57:54 ----''!!
+"{ Package: ''some:funny/package'' }"
+!!
+Object subclass:#Mock1
+ instanceVariableNames:''''
+ classVariableNames:''''
+ poolDictionaries:''''
+ category:''* Mocks *''
+!!
+!!Object methodsFor:''* mocks * ''!!
+
+someMethod
+ ^ 1
+
+!! !!
+
+' readStream.
+
+ self assert: cs size == 3.
+ self assert: cs second package = 'some:funny/package'.
+ self assert: cs third package = 'some:funny/package'.
+
+ "Created: / 05-08-2014 / 10:49:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
test_misc_package_02a
"
When reading class fileout, all methods should have package set, however...