The Trunk: CollectionsTests-nice.335.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: CollectionsTests-nice.335.mcz

commits-2
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.335.mcz

==================== Summary ====================

Name: CollectionsTests-nice.335
Author: nice
Time: 12 March 2020, 12:08:41.875856 pm
UUID: 7bd21d75-b53b-4dc6-a18c-95b65e628d21
Ancestors: CollectionsTests-mt.334

Avoid write-streaming on read-only literal

=============== Diff against CollectionsTests-mt.334 ===============

Item was changed:
  ----- Method: WriteStreamTest>>testCr (in category 'tests - character writing') -----
  testCr
  "self debug: #testCr"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream cr.
  self assert: stream last = Character cr.!

Item was changed:
  ----- Method: WriteStreamTest>>testCrLf (in category 'tests - character writing') -----
  testCrLf
  "self debug: #testCrLf"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream crlf.
  self assert: (stream contents last: 2) = String crlf.!

Item was changed:
  ----- Method: WriteStreamTest>>testCrTab (in category 'tests - character writing') -----
  testCrTab
  "self debug: #testCrTab"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream crtab.
  self assert: (stream contents last: 2) = (String with: Character cr with: Character tab)!

Item was changed:
  ----- Method: WriteStreamTest>>testCrTabs (in category 'tests - character writing') -----
  testCrTabs
  "self debug: #testCrTabs"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream crtab: 2.
  self assert: (stream contents last: 3) = (String with: Character cr with: Character tab with: Character tab)!

Item was changed:
  ----- Method: WriteStreamTest>>testInstanciationUsingOn (in category 'tests - instance creation') -----
  testInstanciationUsingOn
  "self debug: #testInstanciationUsingOn"
  | stream |
+ stream := WriteStream on: #(1 2) copy.
- stream := WriteStream on: #(1 2).
  stream nextPut: 3.
  self assert: stream contents = #(3)!

Item was changed:
  ----- Method: WriteStreamTest>>testLf (in category 'tests - character writing') -----
  testLf
  "self debug: #testLf"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream lf.
  self assert: stream last = Character lf.!

Item was changed:
  ----- Method: WriteStreamTest>>testPosition (in category 'tests - positioning') -----
  testPosition
  "self debug: #testPosition"
 
  | stream |
+ stream := WriteStream with: 'an elephant' copy.
- stream := WriteStream with: 'an elephant'.
  stream position: 6.
  self assert: stream contents = 'an ele'.
 
  stream nextPutAll: 'vator'.
  stream assert: stream contents = 'an elevator'!

Item was changed:
  ----- Method: WriteStreamTest>>testSize (in category 'tests - accessing') -----
  testSize
  "self debug: #testSize"
 
  | string streamEmpty streamFull |
  string := 'a string'.
+ streamEmpty := WriteStream on: string copy.
+ streamFull := WriteStream with: string copy.
- streamEmpty := WriteStream on: string.
- streamFull := WriteStream with: 'a string'.
 
  self assert: streamEmpty size = 0.
  self assert: streamFull size = 8.
 
  streamEmpty nextPut: $..
  streamFull nextPut: $..
  self assert: streamEmpty size = 1.
  self assert: streamFull size = (string size + 1).!

Item was changed:
  ----- Method: WriteStreamTest>>testSpace (in category 'tests - character writing') -----
  testSpace
  "self debug: #testSpace"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream space.
  self assert: stream last = Character space.!

Item was changed:
  ----- Method: WriteStreamTest>>testSpaces (in category 'tests - character writing') -----
  testSpaces
  "self debug: #testSpaces"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream space: 3.
  self assert: (stream contents last: 3) = '   '!

Item was changed:
  ----- Method: WriteStreamTest>>testTab (in category 'tests - character writing') -----
  testTab
  "self debug: #testTab"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream tab.
  self assert: (stream contents last) = Character tab!

Item was changed:
  ----- Method: WriteStreamTest>>testTabs (in category 'tests - character writing') -----
  testTabs
  "self debug: #testTabs"
 
  | stream |
+ stream := WriteStream on: 'stream' copy.
- stream := WriteStream on: 'stream'.
  stream tab: 3.
  self assert: (stream contents last: 3) = (String with: Character tab with: Character tab with: Character tab)!