Skip to content

Commit

Permalink
Add test for missing ; yourself and fix code
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Hagen <[email protected]>
  • Loading branch information
lukasrad02 and Greenscreen23 committed Jun 12, 2022
1 parent 9d53bfb commit b898f30
Show file tree
Hide file tree
Showing 26 changed files with 72 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ buildInfoPanelWith: aToolBuilder
^ aToolBuilder pluggableMultiColumnListSpec new
name: #infoPanel;
model: self model;
list: #infoForSelectedElement
list: #infoForSelectedElement;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ buildTreeViewWith: aToolBuilder
setSelected: #selectedElement:;
getSelected: #selectedElement;
getSelectedPath: #selectedPath;
label: #displayNameOf:
label: #displayNameOf:;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"buildAndOpenFromString:" : "lha 5/17/2022 19:37",
"buildCloseButtonWith:" : "lha 5/17/2022 19:31",
"buildDrawingAreaWith:" : "lha 5/17/2022 19:32",
"buildInfoPanelWith:" : "aes 5/28/2022 12:42",
"buildInfoPanelWith:" : "lra 6/12/2022 19:55",
"buildOpenButtonWith:" : "lha 5/17/2022 19:32",
"buildSaveButtonWith:" : "lha 5/17/2022 19:32",
"buildSwitchesWIth:" : "nh 5/16/2022 15:54",
"buildTreeViewWith:" : "aes 5/28/2022 14:37",
"buildTreeViewWith:" : "lra 6/12/2022 19:55",
"buildWith:" : "aes 5/28/2022 12:28",
"buttonHeight" : "nh 5/15/2022 15:51",
"infoPanelFrame" : "aes 5/28/2022 12:29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGCircle: aCircle

^ self
self
readCommonAttributesOf: aCircle;
readCircleAttributesOf: aCircle;
asList
readCircleAttributesOf: aCircle.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGEllipse: anEllipse

^ self
self
readCommonAttributesOf: anEllipse;
readEllipseAttributesOf: anEllipse;
asList
readEllipseAttributesOf: anEllipse.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
visiting
visitSVGGroup: aGroup

^ self
readCommonAttributesOf: aGroup;
asList
self readCommonAttributesOf: aGroup.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGLine: aLine

^ self
self
readCommonAttributesOf: aLine;
readLineAttributesOf: aLine;
asList
readLineAttributesOf: aLine.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
visiting
visitSVGMorph: aMorph

^ self
readCommonAttributesOf: aMorph;
asList
self readCommonAttributesOf: aMorph.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
visiting
visitSVGPath: aPath

^ self
readCommonAttributesOf: aPath;
asList
self readCommonAttributesOf: aPath.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGPolygon: aPolygon

^ self
self
readCommonAttributesOf: aPolygon;
readPointsOf: aPolygon;
asList
readPointsOf: aPolygon.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGPolyline: aPolyline

^ self
self
readCommonAttributesOf: aPolyline;
readPointsOf: aPolyline;
asList
readPointsOf: aPolyline.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGRectangle: aRectangle

^ self
self
readCommonAttributesOf: aRectangle;
readRectangleAttributesOf: aRectangle;
asList
readRectangleAttributesOf: aRectangle.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGTSpan: aTSpan

^ self
self
readCommonAttributesOf: aTSpan;
readTextAttributesOf: aTSpan;
asList
readTextAttributesOf: aTSpan.
^ self asList
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
visiting
visitSVGText: aText

^ self
self
readCommonAttributesOf: aText;
readTextAttributesOf: aText;
asList
readTextAttributesOf: aText.
^ self asList
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"readTextAttributesOf:" : "aes 5/28/2022 13:11",
"values" : "lra 6/12/2022 16:16",
"values:" : "lra 6/12/2022 16:59",
"visitSVGCircle:" : "aes 5/28/2022 13:51",
"visitSVGEllipse:" : "aes 5/28/2022 14:03",
"visitSVGGroup:" : "aes 5/28/2022 13:02",
"visitSVGLine:" : "aes 5/28/2022 14:02",
"visitSVGMorph:" : "aes 5/28/2022 13:02",
"visitSVGPath:" : "aes 5/28/2022 13:02",
"visitSVGPolygon:" : "aes 5/28/2022 13:47",
"visitSVGPolyline:" : "aes 5/28/2022 13:47",
"visitSVGRectangle:" : "aes 5/28/2022 13:56",
"visitSVGTSpan:" : "aes 5/28/2022 13:11",
"visitSVGText:" : "aes 5/28/2022 13:11" } }
"visitSVGCircle:" : "lra 6/12/2022 19:58",
"visitSVGEllipse:" : "lra 6/12/2022 19:58",
"visitSVGGroup:" : "lra 6/12/2022 19:59",
"visitSVGLine:" : "lra 6/12/2022 19:59",
"visitSVGMorph:" : "lra 6/12/2022 19:59",
"visitSVGPath:" : "lra 6/12/2022 19:59",
"visitSVGPolygon:" : "lra 6/12/2022 20:00",
"visitSVGPolyline:" : "lra 6/12/2022 20:00",
"visitSVGRectangle:" : "lra 6/12/2022 20:00",
"visitSVGTSpan:" : "lra 6/12/2022 20:00",
"visitSVGText:" : "lra 6/12/2022 20:01" } }
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ createFillFromSVGLinearGradient: anElement
normal: nil;
radial: false;
units: (anElement attributeAt: 'gradientUnits' ifAbsent: [#objectBoundingBox]) asSymbol;
spread: (anElement attributeAt: 'spreadMethod' ifAbsent: [#pad]) asSymbol)
spread: (anElement attributeAt: 'spreadMethod' ifAbsent: [#pad]) asSymbol;
yourself)
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ createFillFromSVGRadialGradient: anElement
normal: 0 @ direction y;
radial: true;
units: (anElement attributeAt: 'gradientUnits' ifAbsent: [#userSpaceOnUse]) asSymbol;
spread: (anElement attributeAt: 'spreadMethod' ifAbsent: [#pad]) asSymbol)
spread: (anElement attributeAt: 'spreadMethod' ifAbsent: [#pad]) asSymbol;
yourself)
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"create:fromSVG:" : "lra 6/12/2022 16:25",
"createCircleFromSVGCircle:" : "lra 6/12/2022 18:36",
"createEllipseFromSVGEllipse:" : "lra 6/12/2022 18:36",
"createFillFromSVGLinearGradient:" : "AS 5/15/2022 19:42",
"createFillFromSVGRadialGradient:" : "AS 5/15/2022 19:25",
"createFillFromSVGLinearGradient:" : "lra 6/12/2022 19:55",
"createFillFromSVGRadialGradient:" : "lra 6/12/2022 19:55",
"createFromSVG:" : "AS 5/19/2022 10:17",
"createGroupFromSVGGroup:" : "lra 6/12/2022 18:37",
"createLineFromSVGLine:" : "lra 6/12/2022 18:37",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ mappedToBounds: aRectangle
|o|
self mapsToObjectBounds
ifTrue: [^ self copy
origin: (o := aRectangle origin + (self origin * aRectangle extent));
direction: self direction + self origin * aRectangle extent - o;
normal: nil].
origin: (o := aRectangle origin + (self origin * aRectangle extent));
direction: self direction + self origin * aRectangle extent - o;
normal: nil;
yourself].
^ self
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"computePixelRampOfSize:" : "lra 6/12/2022 19:01",
"interpolatedAlphaMix:of:and:" : "lra 6/12/2022 16:37",
"mappedTo:" : "lra 6/12/2022 18:36",
"mappedToBounds:" : "lra 6/12/2022 18:43",
"mappedToBounds:" : "lra 6/12/2022 19:57",
"mapsToObjectBounds" : "lra 6/12/2022 18:43",
"spread" : "gvc 7/30/2005 20:00",
"spread:" : "lra 6/12/2022 16:52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ setUp
builder := MorphicToolBuilder new.
windowSpec := SVGEditor new
model: self modelMock;
buildWith: builder.
buildWith: builder;
yourself.
morph := builder build: windowSpec.
self wantsToTest: morph
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"modelMock" : "lha 5/17/2022 19:57",
"modelMock:" : "lha 5/17/2022 19:57",
"setUp" : "lha 5/17/2022 19:57",
"setUp" : "lra 6/12/2022 19:55",
"tearDown" : "lha 5/17/2022 18:03",
"testCloseButtonAction" : "lha 5/17/2022 20:12",
"testCloseButtonActionWithoutSVG" : "lha 5/18/2022 12:35",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tests
testsmallLintMissingYourself

"Checks for missing ; yourself cascaded message send for cascaded messages that are used."
self arbitraryCodeRule: #smallLintMissingYourself.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"testsmallLintLiteralArrayCharacters" : "js 6/13/2020 18:37",
"testsmallLintMethodModifierOverride" : "js 6/13/2020 18:37",
"testsmallLintMissingTranslationsInMenus" : "js 6/13/2020 18:37",
"testsmallLintMissingYourself" : "lra 6/12/2022 19:53",
"testsmallLintModifiesCollection" : "js 6/13/2020 18:38",
"testsmallLintOnlyReadOrWrittenTemporary" : "js 6/13/2020 19:21",
"testsmallLintReturnsBooleanAndOther" : "js 6/13/2020 18:38",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
assertions
assertExportOf: anXMLString toBe: anotherXMLString

|morph exportedString|
|morph exporter|
morph := SVGMorph fromString: anXMLString.

exportedString := SVGExporter new
exporter := SVGExporter new
visitSVGMorph: morph;
exportString.
self assert: anotherXMLString equals: exportedString
yourself.
self assert: anotherXMLString equals: (exporter exportString)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
},
"instance" : {
"assertExportOf:toBe:" : "aes 5/23/2022 10:59",
"assertExportOf:toBe:" : "lra 6/12/2022 19:57",
"assertTestCaseToBeCorrect:" : "aes 5/23/2022 11:27",
"atomTestCase" : "lra 6/8/2022 18:49",
"circleTestCase" : "lra 5/28/2022 12:23",
Expand Down

0 comments on commit b898f30

Please sign in to comment.