The Trunk: CollectionsTests-mt.328.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-mt.328.mcz

commits-2
Marcel Taeumel uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-mt.328.mcz

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

Name: CollectionsTests-mt.328
Author: mt
Time: 3 December 2019, 2:09:38.538677 pm
UUID: ea0985d3-958d-d14f-a58c-9cd738eb0d27
Ancestors: CollectionsTests-mt.327

More tests for #findLiteral and #findSymbol. Complements Morphic-mt.1598.

=============== Diff against CollectionsTests-mt.327 ===============

Item was added:
+ ----- Method: StringTest>>testFindLiteral (in category 'tests - finding') -----
+ testFindLiteral
+
+ #(
+ nil '' "empty string"
+ nil '"Comment."' "comment literal"
+
+ 42 '42' "integer literal"
+ 2r1001 '2r1001'
+ -42 '-42' "negative integer literal"
+ -2r1001 '-2r1001'
+
+ 2.34 '2.34' "float literal"
+ 2.34e2 '2.34e2'
+ 2.34e-2 '2.34e-2'
+
+ 1e20 '1e20' "large positive integer"
+ -1e20 '-1e20' "large negative integer"
+
+ #() '#()' "empty literal array"
+ #(a 5 'c') '#(a 5 ''c'')' "literal array"
+
+ 'Hello' '''Hello''' "string literal"
+ 'drawOn:' 'drawOn:' "identifier or message send"
+ #drawOn: '#drawOn:' "symbol literal"
+
+ ${ '{}' "opening bracket of empty object literal"
+ ${ '{1. 2}' "opening bracket of empty object literal"
+
+ 42 '42 23' "first literal only"
+
+ ) pairsDo: [:literal :string |
+ self assert: (literal literalEqual: string findLiteral)].!

Item was changed:
  ----- Method: StringTest>>testFindSelector (in category 'tests - finding') -----
  testFindSelector
 
  #(
  #negated 'negated' "Simplest case."
  #negated '#negated' "Ignore leading #"
  #negated '   negated' "Ignore leading whitespace"
 
  nil 'shouldnotexist42' "Do not intern new symbols."
+ nil '' "No empty symbols."
 
  #copy 'self copy' "Ignore leading receiver."
  #copyWithout: 'self copyWithout: 42' "Ignore leading receiver."
  #negated 'self copy negated' "Choose last selector if several."
 
  #drawOn: 'drawOn:'
  nil 'drawOn' "Do not add colons."
  #drawOn: 'drawOn: aCanvas' "Ignore argument"
 
  #at:put: 'at: 42 put: nil' "Ignore arguments"
  #at:put: 'at: #drawOn: put: 42' "Ignore colons in arguments."
  #at:put: 'at:42 put:43' "Scarce whitepsace"
 
  #ifTrue: 'ifTrue: [self open]'
  #ifTrue:ifFalse: 'ifTrue: [] ifFalse: [self close]'
  #ifNotEmpty: 'ifNotEmpty: [:all | all sum]'
 
  #+ '+'
  #+ '1 +'
  nil '+ 2'
  nil '1 + 2'
 
  ) pairsDo: [:selector :string |
  self assert: selector equals: string findSelector].!

Item was added:
+ ----- Method: StringTest>>testFindSymbol (in category 'tests - finding') -----
+ testFindSymbol
+
+ #(
+ #negated 'negated' "Simplest case."
+ #drawOn: 'drawOn:'
+ #String 'String' "class name or other global variables"
+
+ nil '#negated' "No string modification"
+ nil 'shouldnotexist42' "Do not intern new symbols."
+ nil '' "No empty symbols."
+ nil 'drawOn' "Do not add colons."
+ nil '#(a b c)'
+
+ "Ignore whitespace"
+ #negated '   negated'
+ #at:put: 'at: put: '
+ #+ '+  '
+ #** '*     *'
+ ) pairsDo: [:selector :string |
+ self assert: selector equals: string findSymbol].!