[Seaside-dev] Re: [Seaside Commits] Seaside 3.0:
Seaside-Tests-Slime-jok.39.mcz
Julian Fitzell
jfitzell at gmail.com
Tue Jan 26 22:11:50 UTC 2010
I *think* I would rather see these on a WA-prefixed subclass of the
test case rather than as extensions... anyone else?
Julian
On Tue, Jan 26, 2010 at 1:12 PM,
<squeak-dev-noreply at lists.squeakfoundation.org> wrote:
> John O'Keefe uploaded a new version of Seaside-Tests-Slime to project Seaside 3.0:
> http://www.squeaksource.com/Seaside30/Seaside-Tests-Slime-jok.39.mcz
>
> ==================== Summary ====================
>
> Name: Seaside-Tests-Slime-jok.39
> Author: jok
> Time: 26 January 2010, 3:34:53 pm
> UUID: fbaa6f8e-411e-c545-8e19-ab00aaa8807d
> Ancestors: Seaside-Tests-Slime-jok.38
>
> Test Seaside-specific Slime rules
>
> =============== Diff against Seaside-Tests-Slime-jok.38 ===============
>
> Item was added:
> + ----- Method: GRSlimeTest>>testCallSuperImplementation (in category '*seaside-tests-slime') -----
> + testCallSuperImplementation
> + | object painter |
> + object := self
> + defineClass: #WASlimeMockObject
> + superclass: #WAObject.
> + self compile: 'postCopy self postCopy' in: object.
> + painter := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAPainter.
> + self compile: 'updateRoot: aHtmlRoot self updateUrl: aHtmlRoot' in: painter.
> + self
> + runRule: WACallSuperImplementationRule
> + selectors: #(postCopy updateRoot:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testChangesStateWhileRendering (in category '*seaside-tests-slime') -----
> + testChangesStateWhileRendering
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class addInstanceVariable: 'foo'.
> + self compile: 'renderContentOn: html html div: [ foo := nil ]' in: class.
> + self
> + runRule: WAChangesStateWhileRenderingRule
> + selectors: #(renderContentOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testDoNotUseWithinCallback (in category '*seaside-tests-slime') -----
> + testDoNotUseWithinCallback
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + self compile: 'renderContentOn: html
> + html anchor
> + callback: [ html document addLoadScript: nil ];
> + with: 123' in: class.
> + self
> + runRule: WADoNotUseWithinCallbackRule
> + selectors: #(renderContentOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testDoNotUseWhileRendering (in category '*seaside-tests-slime') -----
> + testDoNotUseWhileRendering
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + self compile: 'renderContentOn: html html div: [ self call: nil ]' in: class.
> + self
> + runRule: WADoNotUseWhileRenderingRule
> + selectors: #(renderContentOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testSendsRenderContentOn (in category '*seaside-tests-slime') -----
> + testSendsRenderContentOn
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'invalid self renderContentOn: nil'
> + classified: #(rendering).
> + self
> + runRule: WASendsRenderContentOnRule
> + selectors: #(invalid)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testWithHasToBeLastMessageInCascade (in category '*seaside-tests-slime') -----
> + testWithHasToBeLastMessageInCascade
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'renderContent01On: html
> + html div
> + with: ''foo'';
> + class: ''bar''.'
> + classified: #(rendering).
> + class
> + compile: 'renderContent02On: html
> + html div
> + id: ''zork'';
> + with: ''foo'';
> + class: ''bar''.'
> + classified: #(rendering).
> + self
> + runRule: WAWithHasToBeLastMessageInCascadeRule
> + selectors: #(renderContent01On: renderContent02On:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testExtractCallbackCodeToMethod (in category '*seaside-tests-slime') -----
> + testExtractCallbackCodeToMethod
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'renderInvalidOn: html
> + html anchor
> + callback: [ self foo. self bar ];
> + with: 1'
> + classified: #(rendering).
> + class
> + compile: 'renderValidOn: html
> + html anchor
> + callback: [ self foo ];
> + with: 1'
> + classified: #(rendering).
> + self
> + runRule: WAExtractCallbackCodeToMethodRule
> + selectors: #(renderInvalidOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testFixCallbackTempsMissing (in category '*seaside-tests-slime') -----
> + testFixCallbackTempsMissing
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + self
> + compile: 'callbackTemps | r | r := OrderedCollection new. (1 to: 10) do: [ :e | r add: [ e ] ]'
> + in: class.
> + self
> + runRule: WAFixCallbackTempsMissingRule
> + selectors: #(callbackTemps)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testSequencedAsynchronousCalls (in category '*seaside-tests-slime') -----
> + testSequencedAsynchronousCalls
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'renderContent1On: html
> + html div
> + onClick: (html jQuery ajax callback: [ ]) , (html jQuery ajax serializeForm);
> + with: ''Click me'''
> + classified: #(rendering).
> + class
> + compile: 'renderContent2On: html
> + html div
> + onClick: (html jQuery ajax serializeForm; callback: [ ]) , (html jQuery effect bounce);
> + with: ''Click me'''
> + classified: #(rendering).
> + self
> + runRule: WASequencedAsynchronousCallsRule
> + selectors: #(renderContent1On: renderContent2On:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testInstantiatesComponentWhileRendering (in category '*seaside-tests-slime') -----
> + testInstantiatesComponentWhileRendering
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + self compile: 'renderContentOn: html html div: WAComponentStub new' in: class.
> + self
> + runRule: WAInstantiatesComponentWhileRenderingRule
> + selectors: #(renderContentOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testSessionExpiredRule (in category '*seaside-tests-slime') -----
> + testSessionExpiredRule
> + | class |
> + class := self
> + defineClass: #WASlimeMockSession
> + superclass: #WASession.
> + self compile: 'expired self cleanup' in: class.
> + self
> + runTransformation: WASessionExpiredRule
> + changes: #('unregistered self cleanup')!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testUnnecessaryWithSentToBrush (in category '*seaside-tests-slime') -----
> + testUnnecessaryWithSentToBrush
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'renderContentOn: html html div with: 123'
> + classified: #(rendering).
> + self
> + runRule: WAUnnecessaryWithSentToBrushRule
> + selectors: #(renderContentOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testUsesWrongRenderer (in category '*seaside-tests-slime') -----
> + testUsesWrongRenderer
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'renderContentOn: html
> + html updater callback: [ :r | html div ]'
> + classified: #(rendering).
> + self
> + runRule: WAUsesWrongRendererRule
> + selectors: #(renderContentOn:)!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testHandleRequestRule (in category '*seaside-tests-slime') -----
> + testHandleRequestRule
> + | class |
> + class := self
> + defineClass: #WASlimeMockHandler
> + superclass: #WARequestHandler.
> + self compile: 'handleRequest: aRequest aRequest notFound' in: class.
> + self
> + runTransformation: WAHandleRequestRule
> + changes: #('handleFiltered: aRequestContext aRequestContext request notFound')!
>
> Item was added:
> + ----- Method: GRSlimeTest>>testUnnecessaryBlockPassedToBrush (in category '*seaside-tests-slime') -----
> + testUnnecessaryBlockPassedToBrush
> + | class |
> + class := self
> + defineClass: #WASlimeMockComponent
> + superclass: #WAComponent.
> + class
> + compile: 'renderContent01On: html html div: [ ]'
> + classified: #(rendering).
> + class
> + compile: 'renderContent02On: html html div: [ html text: 2 ]'
> + classified: #(rendering).
> + class
> + compile: 'renderContent03On: html html div: [ html render: 3 ]'
> + classified: #(rendering).
> + class
> + compile: 'renderContent04On: html html div class: #foo; with: [ ]'
> + classified: #(rendering).
> + class
> + compile: 'renderContent05On: html html div class: #foo; with: [ html text: 5 ]'
> + classified: #(rendering).
> + class
> + compile: 'renderContent06On: html html div class: #foo; with: [ html render: 6 ]'
> + classified: #(rendering).
> + self
> + runRule: WAUnnecessaryBlockPassedToBrushRule
> + selectors: #(renderContent01On: renderContent02On: renderContent03On: renderContent04On: renderContent05On: renderContent06On:)!
>
> Item was changed:
> ----- Method: GRPackage class>>seasideTestsSlime (in category '*seaside-tests-slime') -----
> seasideTestsSlime
> ^ self new
> name: 'Seaside-Tests-Slime';
> description: 'Unit tests for the package Seaside-Slime.';
> addDependency: 'Seaside-Slime';
> + addDependency: 'Grease-Tests-Slime';
> addDependency: 'Seaside-Tests-Component';
> yourself!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testDoNotUseWithinCallback (in category 'testing-block') -----
> - testDoNotUseWithinCallback
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - self compile: 'renderContentOn: html
> - html anchor
> - callback: [ html document addLoadScript: nil ];
> - with: 123' in: class.
> - self
> - runRule: WADoNotUseWithinCallbackRule
> - selectors: #(renderContentOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testInvalidObjectInitialization (in category 'testing-block') -----
> - testInvalidObjectInitialization
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'initializeFoo: aNumber' in: class.
> - self
> - runRule: WAInvalidObjectInitializationRule
> - selectors: #(initializeFoo:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUsesMethodAnnotations (in category 'testing-block') -----
> - testUsesMethodAnnotations
> - | class |
> - (self canParse: 'foo <foo: 123>')
> - ifFalse: [ ^ self ].
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'invalid <foo: 123>' in: class.
> - self compile: 'valid' in: class.
> - self
> - runRule: WAUsesMethodAnnotationsRule
> - selectors: #(invalid)!
>
> Item was removed:
> - TestCase subclass: #WASlimeTest
> - instanceVariableNames: 'model environment'
> - classVariableNames: ''
> - poolDictionaries: ''
> - category: 'Seaside-Tests-Slime'!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUsesNotPortableClass (in category 'testing-block') -----
> - testUsesNotPortableClass
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'invalid ^ Semaphore new' in: class.
> - self compile: 'valid ^ WAObject new' in: class.
> - self
> - runRule: WAUsesNotPortableClassRule
> - selectors: #(invalid)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testBasicNewInitializeMissing (in category 'testing-block') -----
> - testBasicNewInitializeMissing
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #Object.
> - self compile: 'initialize' in: class.
> - self
> - runRule: WABasicNewInitializeMissingRule
> - selectors: #(initialize)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUsesWrongRenderer (in category 'testing-parsetree') -----
> - testUsesWrongRenderer
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'renderContentOn: html
> - html updater callback: [ :r | html div ]'
> - classified: #(rendering).
> - self
> - runRule: WAUsesWrongRendererRule
> - selectors: #(renderContentOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>tearDown (in category 'running') -----
> - tearDown
> - super tearDown.
> - Smalltalk organization
> - removeCategory: self category!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiBooleansRule (in category 'testing-transform') -----
> - testAnsiBooleansRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'and 1 and: [ 2 ] and: [ 3 ] and: [ 4 ]' in: class.
> - self compile: 'or 1 or: [ 2 ] or: [ 3 ] or: [ 4 ]' in: class.
> - self
> - runTransformation: WAAnsiBooleansRule
> - changes: #(
> - 'and 1 and: [ 2 and: [ 3 and: [ 4 ] ] ]'
> - 'or 1 or: [ 2 or: [ 3 or: [ 4 ] ] ]' )!
>
> Item was removed:
> - ----- Method: WASlimeTest>>runCase (in category 'running') -----
> - runCase
> - SystemChangeNotifier uniqueInstance
> - doSilently: [ super runCase ]!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testDoNotUseWhileRendering (in category 'testing-block') -----
> - testDoNotUseWhileRendering
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - self compile: 'renderContentOn: html html div: [ self call: nil ]' in: class.
> - self
> - runRule: WADoNotUseWhileRenderingRule
> - selectors: #(renderContentOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiExceptionsRule (in category 'testing-transform') -----
> - testAnsiExceptionsRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'exception1 [ self or ] on: Error do: [ self or ]' in: class.
> - self compile: 'exception2 [ self or ] on: Error do: [ self or. self or ]' in: class.
> - self compile: 'exception3 [ self or ] on: Error do: [ | a | a := 0 ]' in: class.
> - self
> - runTransformation: WAAnsiExceptionsRule
> - changes: #(
> - 'exception1 [ self or ] on: Error do: [ :err | self or ]'
> - 'exception2 [ self or ] on: Error do: [ :err | self or. self or ]'
> - 'exception3 [ self or ] on: Error do: [ :err | | a | a := 0 ]' )!
>
> Item was removed:
> - ----- Method: WASlimeTest>>rules (in category 'accessing') -----
> - rules
> - ^ OrderedCollection new
> - addAll: WASlimeBlockLintRule allSubclasses;
> - addAll: WASlimeParseTreeLintRule allSubclasses;
> - addAll: WASlimeTransformationRule allSubclasses;
> - yourself!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testExtractCallbackCodeToMethod (in category 'testing-parsetree') -----
> - testExtractCallbackCodeToMethod
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'renderInvalidOn: html
> - html anchor
> - callback: [ self foo. self bar ];
> - with: 1'
> - classified: #(rendering).
> - class
> - compile: 'renderValidOn: html
> - html anchor
> - callback: [ self foo ];
> - with: 1'
> - classified: #(rendering).
> - self
> - runRule: WAExtractCallbackCodeToMethodRule
> - selectors: #(renderInvalidOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testEmptyStatements (in category 'testing-block') -----
> - testEmptyStatements
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'emptyStatement1. self and' in: class.
> - self compile: 'emptyStatement2 self and..' in: class.
> - self compile: 'emptyStatement3 self and."foo".' in: class.
> - self compile: 'emptyStatement4 self and."foo".self and' in: class.
> - self
> - runRule: WAEmptyStatementsRule
> - selectors: #(emptyStatement1 emptyStatement2 emptyStatement3 emptyStatement4)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testSequencedAsynchronousCalls (in category 'testing-parsetree') -----
> - testSequencedAsynchronousCalls
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'renderContent1On: html
> - html div
> - onClick: (html jQuery ajax callback: [ ]) , (html jQuery ajax serializeForm);
> - with: ''Click me'''
> - classified: #(rendering).
> - class
> - compile: 'renderContent2On: html
> - html div
> - onClick: (html jQuery ajax serializeForm; callback: [ ]) , (html jQuery effect bounce);
> - with: ''Click me'''
> - classified: #(rendering).
> - self
> - runRule: WASequencedAsynchronousCallsRule
> - selectors: #(renderContent1On: renderContent2On:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testSessionExpiredRule (in category 'testing-transform') -----
> - testSessionExpiredRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockSession
> - superclass: #WASession.
> - self compile: 'expired self cleanup' in: class.
> - self
> - runTransformation: WASessionExpiredRule
> - changes: #('unregistered self cleanup')!
>
> Item was removed:
> - ----- Method: WASlimeTest>>run:do: (in category 'running-checks') -----
> - run: aClass do: aBlock
> - | rules rule composite undo |
> - rules := self rules
> - collect: [ :each | each new ].
> - rule := rules
> - detect: [ :each | each isKindOf: aClass ]
> - ifNone: [ self error: aClass name , ' is not a slime rule' ].
> - self
> - assert: (rule name isString and: [ rule name notEmpty ])
> - description: aClass name , ' has no name'.
> - self
> - assert: (rule rationale isString and: [ rule rationale notEmpty and: [ rule rationale endsWith: '.' ] ])
> - description: aClass name , ' has no rationale'.
> - composite := RBCompositeLintRule rules: rules name: 'Slime'.
> - undo := model changes execute.
> - [ SmalllintChecker runRule: composite onEnvironment: environment.
> - rules do: [ :each |
> - self
> - assert: (rule = each or: [ each result isEmpty and: [ each changes isEmpty ] ])
> - description: each name , ' should not report errors' ].
> - aBlock value: rule value: rules ]
> - ensure: [ undo execute ].
> - ^ rule!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testHandleRequestRule (in category 'testing-transform') -----
> - testHandleRequestRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockHandler
> - superclass: #WARequestHandler.
> - self compile: 'handleRequest: aRequest aRequest notFound' in: class.
> - self
> - runTransformation: WAHandleRequestRule
> - changes: #('handleFiltered: aRequestContext aRequestContext request notFound')!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testObjectIn (in category 'testing-transform') -----
> - testObjectIn
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'objectIn1 1 in: [ :val | val factorial ]' in: class.
> - self compile: 'objectIn2 2 in: [ :val | | temps | val factorial ]' in: class.
> - self compile: 'objectIn3 2 in: [ ''not this'' ]' in: class.
> - self
> - runTransformation: WAObjectInRule
> - changes: #(
> - 'objectIn1 [ :val | val factorial ] value: 1'
> - 'objectIn2 [ :val | | temps | val factorial ] value: 2')!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUnnecessaryBlockPassedToBrush (in category 'testing-parsetree') -----
> - testUnnecessaryBlockPassedToBrush
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'renderContent01On: html html div: [ ]'
> - classified: #(rendering).
> - class
> - compile: 'renderContent02On: html html div: [ html text: 2 ]'
> - classified: #(rendering).
> - class
> - compile: 'renderContent03On: html html div: [ html render: 3 ]'
> - classified: #(rendering).
> - class
> - compile: 'renderContent04On: html html div class: #foo; with: [ ]'
> - classified: #(rendering).
> - class
> - compile: 'renderContent05On: html html div class: #foo; with: [ html text: 5 ]'
> - classified: #(rendering).
> - class
> - compile: 'renderContent06On: html html div class: #foo; with: [ html render: 6 ]'
> - classified: #(rendering).
> - self
> - runRule: WAUnnecessaryBlockPassedToBrushRule
> - selectors: #(renderContent01On: renderContent02On: renderContent03On: renderContent04On: renderContent05On: renderContent06On:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testChangesStateWhileRendering (in category 'testing-block') -----
> - testChangesStateWhileRendering
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class addInstanceVariable: 'foo'.
> - self compile: 'renderContentOn: html html div: [ foo := nil ]' in: class.
> - self
> - runRule: WAChangesStateWhileRenderingRule
> - selectors: #(renderContentOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>defineClass:superclass: (in category 'accessing-code') -----
> - defineClass: aClassSymbol superclass: aSuperSymbol
> - | class |
> - model defineClass: aSuperSymbol , ' subclass: #' , aClassSymbol , '
> - instanceVariableNames: ''''
> - classVariableNames: ''''
> - poolDictionaries: ''''
> - category: ''' , self category , ''''.
> - class := model classNamed: aClassSymbol.
> - environment
> - addClass: class;
> - addClass: class theMetaClass.
> - ^ class!
>
> Item was removed:
> - ----- Method: WASlimeTest>>setUp (in category 'running') -----
> - setUp
> - super setUp.
> - model := RBNamespace new.
> - environment := ClassEnvironment new!
>
> Item was removed:
> - ----- Method: WASlimeTest>>runTransformation:changes: (in category 'running-checks') -----
> - runTransformation: aClass changes: aCollection
> - | expected |
> - expected := aCollection
> - collect: [ :each | RBParser parseMethod: each ].
> - self run: aClass do: [ :rule :rules |
> - rule changes do: [ :change |
> - self
> - assert: (expected anySatisfy: [ :parseTree | change parseTree = parseTree ])
> - description: change selector , ' should not be transformed' ].
> - expected do: [ :parseTree |
> - self
> - assert: (rule changes anySatisfy: [ :change | change parseTree = parseTree ])
> - description: parseTree selector , ' should be transformed' ] ]!
>
> Item was removed:
> - ----- Method: WASlimeTest>>category (in category 'accessing') -----
> - category
> - ^ self class category , '-Data'!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUsesCurlyBraceArrays (in category 'testing-parsetree') -----
> - testUsesCurlyBraceArrays
> - | class |
> - (self canParse: 'foo { self foo. self bar }')
> - ifFalse: [ ^ self ].
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - class
> - compile: 'invalid
> - ^ { self foo. self bar }'
> - classified: #(accessing).
> - class
> - compile: 'valid
> - ^ Array new'
> - classified: #(accessing).
> - self
> - runRule: WAUsesCurlyBraceArraysRule
> - selectors: #(invalid)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testInstantiatesComponentWhileRendering (in category 'testing-block') -----
> - testInstantiatesComponentWhileRendering
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - self compile: 'renderContentOn: html html div: WAComponentStub new' in: class.
> - self
> - runRule: WAInstantiatesComponentWhileRenderingRule
> - selectors: #(renderContentOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiConditionalsRule (in category 'testing-transform') -----
> - testAnsiConditionalsRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'ifNotNil 1 ifNotNil: [ | a | self or. self and ]' in: class.
> - self compile: 'ifNotNilDo 1 ifNotNilDo: [ :a | ^ a ]' in: class.
> - self
> - runTransformation: WAAnsiConditionalsRule
> - changes: #(
> - 'ifNotNil 1 ifNotNil: [ :arg | | a | self or. self and ]'
> - 'ifNotNilDo 1 ifNotNil: [ :a | ^ a ]' )!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiStringsRule (in category 'testing-transform') -----
> - testAnsiStringsRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'stringCr String cr, (String with: Character cr)' in: class.
> - self compile: 'stringTab String tab, (String with: Character tab)' in: class.
> - self compile: 'stringLf String lf, (String with: Character lf)' in: class.
> - self compile: 'stringCrLf String crlf, (String with: Character cr with: Character lf)' in: class.
> - self compile: 'stringSpace String space, (String with: Character space)' in: class.
> - self compile: 'findTokens ''123'' findTokens: '',''' in: class.
> - self compile: 'findTokensCharacter ''123'' findTokens: $,' in: class.
> - self
> - runTransformation: WAAnsiStringsRule
> - changes: #(
> - 'stringCr (String with: Character cr), (String with: Character cr)'
> - 'stringTab (String with: Character tab), (String with: Character tab)'
> - 'stringLf (String with: Character lf), (String with: Character lf)'
> - 'stringCrLf (String with: Character cr with: Character lf), (String with: Character cr with: Character lf)'
> - 'stringSpace (String with: Character space), (String with: Character space)'
> - 'findTokens ''123'' subStrings: '','''
> - 'findTokensCharacter ''123'' subStrings: '',''' )!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testCallSuperImplementation (in category 'testing-block') -----
> - testCallSuperImplementation
> - | object painter |
> - object := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'postCopy self postCopy' in: object.
> - painter := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAPainter.
> - self compile: 'updateRoot: aHtmlRoot self updateUrl: aHtmlRoot' in: painter.
> - self
> - runRule: WACallSuperImplementationRule
> - selectors: #(postCopy updateRoot:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiCollectionsRule (in category 'testing-transform') -----
> - testAnsiCollectionsRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'withIndexDo #() withIndexDo: [ :each :index | each + index ]' in: class.
> - self compile: 'doWithIndex #() doWithIndex: [ :each :index | each + index ]' in: class.
> - self compile: 'collectThenDo #() collect: [ :a | a ] thenDo: [ :b | b ]' in: class.
> - self compile: 'collectThenSelect #() collect: [ :a | a ] thenSelect: [ :b | true ]' in: class.
> - self compile: 'detectSum #(1 2) detectSum: [ :each | each]' in: class.
> - self compile: 'detectSumMultiline #(1 2) detectSum: [ :each | #foo copy. each ]' in: class.
> - self compile: 'pairsDo #(1 2 3 4) pairsDo: [ :a :b | b ]' in: class.
> - self compile: 'rejectThenDo #() reject: [ :a | true ] thenDo: [ :b | b ]' in: class.
> - self compile: 'selectThenCollect #() select: [ :a | true ] thenCollect: [ :b | b ]' in: class.
> - self compile: 'selectThenDo #() select: [ :a | true ] thenDo: [ :b | b ]' in: class.
> - self compile: 'valuesDo #() valuesDo: [ :a | a ]' in: class.
> - self compile: 'keysSortedSafely Dictionary new keysSortedSafely' in: class.
> - self compile: 'newWithAll Array new: 4 withAll: $a' in: class.
> - self
> - runTransformation: WAAnsiCollectionsRule
> - changes: #(
> - 'withIndexDo #() keysAndValuesDo: [ :index :each | each + index ]'
> - 'doWithIndex #() keysAndValuesDo: [ :index :each | each + index ]'
> - 'collectThenDo (#() collect: [ :a | a ]) do: [ :b | b ]'
> - 'selectThenDo (#() select: [ :a | true ]) do: [ :b | b ]'
> - 'rejectThenDo (#() reject: [ :a | true ]) do: [ :b | b ]'
> - 'selectThenCollect (#() select: [ :a | true ]) collect: [ :b | b ]'
> - 'pairsDo 1 to: #(1 2 3 4) size by: 2 do: [ :index | |a b| a := #(1 2 3 4) at: index. b := #(1 2 3 4) at: index + 1. b ]'
> - 'collectThenSelect (#() collect: [ :a | a ]) select: [ :b | true ]'
> - 'detectSum #(1 2) inject: 0 into: [ :sum :each | sum + each ]'
> - 'detectSumMultiline #(1 2) inject: 0 into: [ :sum :each | #foo copy. sum + each ]'
> - 'valuesDo #() do: [ :a | a ]'
> - 'keysSortedSafely Dictionary new keys asSortedCollection'
> - 'newWithAll (Array new: 4) atAllPut: $a'
> - )!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiConvertorRule (in category 'testing-transform') -----
> - testAnsiConvertorRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'convertInteger ''1'' asInteger' in: class.
> - self compile: 'convertString 2 asString' in: class.
> - self
> - runTransformation: WAAnsiConvertorRule
> - changes: #(
> - 'convertInteger ''1'' greaseInteger'
> - 'convertString 2 greaseString' )!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testSendsRenderContentOn (in category 'testing-parsetree') -----
> - testSendsRenderContentOn
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'invalid self renderContentOn: nil'
> - classified: #(rendering).
> - self
> - runRule: WASendsRenderContentOnRule
> - selectors: #(invalid)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testWithHasToBeLastMessageInCascade (in category 'testing-parsetree') -----
> - testWithHasToBeLastMessageInCascade
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'renderContent01On: html
> - html div
> - with: ''foo'';
> - class: ''bar''.'
> - classified: #(rendering).
> - class
> - compile: 'renderContent02On: html
> - html div
> - id: ''zork'';
> - with: ''foo'';
> - class: ''bar''.'
> - classified: #(rendering).
> - self
> - runRule: WAWithHasToBeLastMessageInCascadeRule
> - selectors: #(renderContent01On: renderContent02On:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testFixCallbackTempsMissing (in category 'testing-parsetree') -----
> - testFixCallbackTempsMissing
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - self
> - compile: 'callbackTemps | r | r := OrderedCollection new. (1 to: 10) do: [ :e | r add: [ e ] ]'
> - in: class.
> - self
> - runRule: WAFixCallbackTempsMissingRule
> - selectors: #(callbackTemps)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUnnecessaryWithSentToBrush (in category 'testing-parsetree') -----
> - testUnnecessaryWithSentToBrush
> - | class |
> - class := self
> - defineClass: #WASlimeMockComponent
> - superclass: #WAComponent.
> - class
> - compile: 'renderContentOn: html html div with: 123'
> - classified: #(rendering).
> - self
> - runRule: WAUnnecessaryWithSentToBrushRule
> - selectors: #(renderContentOn:)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testUsesLiteralByteArrays (in category 'testing-parsetree') -----
> - testUsesLiteralByteArrays
> - | class |
> - (self canParse: 'foo #[ 1 2 3 ]')
> - ifFalse: [ ^ self ].
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - class
> - compile: 'invalid
> - ^ #[ 1 2 3 ]'
> - classified: #(accessing).
> - class
> - compile: 'valid
> - ^ ByteArray with: 1 with: 2 with: 3'
> - classified: #(accessing).
> - self
> - runRule: WAUsesLiteralByteArraysRule
> - selectors: #(invalid)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiCharacterRule (in category 'testing-transform') -----
> - testAnsiCharacterRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'character Character value: 123' in: class.
> - self compile: 'characterRange $a to: $c' in: class.
> - self
> - runTransformation: WAAnsiCharactersRule
> - changes: #('character Character codePoint: 123' 'characterRange ''abc''')!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testDeprecatedApiProtocol (in category 'testing-block') -----
> - testDeprecatedApiProtocol
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'deprecated1 self greaseDeprecatedApi: ''WASlimeMockObject>>#deprecated1'' details: ''Something.''' in: class.
> - self compile: 'deprecated2 self greaseDeprecatedApi: ''WASlimeMockObject>>#deprecated'' details: ''Something.''' in: class.
> - self compile: 'deprecated3 self greaseDeprecatedApi: ''WASlimeMock>>#deprecated3'' details: ''Something.''' in: class.
> - self
> - runRule: WADeprecatedApiProtocolRule
> - selectors: #(deprecated2 deprecated3)!
>
> Item was removed:
> - ----- Method: WASlimeTest>>testAnsiStreamsRule (in category 'testing-transform') -----
> - testAnsiStreamsRule
> - | class |
> - class := self
> - defineClass: #WASlimeMockObject
> - superclass: #WAObject.
> - self compile: 'writeStream ^ '''' writeStream' in: class.
> - self compile: 'writeCr | stream | stream := WriteStream on: ''''. stream cr. stream nextPut: Character cr' in: class.
> - self compile: 'writeLf | stream | stream := WriteStream on: ''''. stream lf. stream nextPut: Character lf' in: class.
> - self
> - runTransformation: WAAnsiStreamsRule
> - changes: #(
> - 'writeStream ^ WriteStream on: '''''
> - 'writeCr | stream | stream := WriteStream on: ''''. stream nextPut: Character cr. stream nextPut: Character cr'
> - 'writeLf | stream | stream := WriteStream on: ''''. stream nextPut: Character lf. stream nextPut: Character lf')!
>
> Item was removed:
> - ----- Method: WASlimeTest>>canParse: (in category 'accessing-code') -----
> - canParse: aString
> - RBParser
> - parseMethod: aString
> - onError: [ :err :pos | ^ false ].
> - ^ true!
>
> Item was removed:
> - ----- Method: WASlimeTest>>runRule:selectors: (in category 'running-checks') -----
> - runRule: aClass selectors: aCollection
> - self run: aClass do: [ :rule :rules |
> - rule result classesAndSelectorsDo: [ :class :selector |
> - self
> - assert: (aCollection includes: selector)
> - description: selector printString , ' should not be reported' ].
> - aCollection do: [ :selector |
> - self
> - assert: (rule result classes
> - anySatisfy: [ :class | rule result includesSelector: selector in: class ])
> - description: selector printString , ' should be reported' ] ]!
>
> Item was removed:
> - ----- Method: WASlimeTest>>compile:in: (in category 'accessing-code') -----
> - compile: aString in: aClass
> - ^ aClass compile: aString classified: #(accessing)!
>
>
> _______________________________________________
> commits mailing list
> To unsubscribe, email commits-leave at lists.seaside.st
> http://lists.seaside.st/listinfo/commits
>
More information about the seaside-dev
mailing list