Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
astares committed Sep 9, 2023
2 parents 8fe21a2 + a9430d6 commit 45a5b46
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 20 deletions.
22 changes: 22 additions & 0 deletions src/Artefact-Core-Tests/ManifestArtefactCoreTests.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"
Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
"
Class {
#name : #ManifestArtefactCoreTests,
#superclass : #PackageManifest,
#category : #'Artefact-Core-Tests-Manifest'
}

{ #category : #'code-critics' }
ManifestArtefactCoreTests class >> ruleCollectionProtocolRuleV1FalsePositive [

<ignoreForCoverage>
^ #(#(#(#RGMethodDefinition #(#PDFStreamPrinterTest #testGenerateGZipCompression #false)) #'2023-09-10T00:13:22.863+02:00') )
]

{ #category : #'code-critics' }
ManifestArtefactCoreTests class >> ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive [

<ignoreForCoverage>
^ #(#(#(#RGMetaclassDefinition #(#'ManifestArtefactCoreTests class' #ManifestArtefactCoreTests)) #'2023-09-10T00:13:40.462+02:00') )
]
3 changes: 2 additions & 1 deletion src/Artefact-Core-Tests/PDFBasicTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ PDFBasicTest >> element: anObject [
{ #category : #running }
PDFBasicTest >> setUp [

super setUp.
self element: PDFDummyBasic new
]

{ #category : #tests }
PDFBasicTest >> testSplitCoordinates [

self assert: (self element splitCoordinates: 20@30) = '20 30'
self assert: (self element splitCoordinates: 20@30) equals: '20 30'
]
2 changes: 1 addition & 1 deletion src/Artefact-Core-Tests/PDFColorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ PDFColorTest >> testEqual [
{ #category : #tests }
PDFColorTest >> testEqualDifferents [

self deny: (PDFColor r: 54 g: 98 b: 12) = (PDFColor r: 12 g: 48 b: 79)
self deny: (PDFColor r: 54 g: 98 b: 12) equals: (PDFColor r: 12 g: 48 b: 79)
]
4 changes: 3 additions & 1 deletion src/Artefact-Core-Tests/PDFDataTypeTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ PDFDataTypeTest >> assert: aPDFDataType print: aString [
]

{ #category : #running }
PDFDataTypeTest >> setUp [
PDFDataTypeTest >> setUp [

super setUp.
aStream := WriteStream on: ''
]

Expand Down
11 changes: 11 additions & 0 deletions src/Artefact-Core-Tests/PDFDummyBasic.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ PDFDummyBasic >> defaultStyle [

^ #default
]

{ #category : #testing }
PDFDummyBasic >> isDrawElement [

^ true
]

{ #category : #render }
PDFDummyBasic >> producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet [
"Do nothing here"
]
5 changes: 1 addition & 4 deletions src/Artefact-Core-Tests/PDFFontTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ PDFFontTest >> page: anObject [
{ #category : #running }
PDFFontTest >> setUp [

super setUp.
self doc: PDFDocument new
]

{ #category : #running }
PDFFontTest >> tearDown [
]

{ #category : #'tests - fonts width' }
PDFFontTest >> testCourierBIWidth [

Expand Down
3 changes: 2 additions & 1 deletion src/Artefact-Core-Tests/PDFGeneratorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ Class {
{ #category : #running }
PDFGeneratorTest >> setUp [

super setUp.
generator := PDFGenerator new
]

{ #category : #tests }
PDFGeneratorTest >> testGenerateEmptyPage [

| page pageDataType contentDataType document |
| page pageDataType document |
document := PDFDocument new uncompressed.
page := PDFPage new format: PDFA4Format new.
document add: page.
Expand Down
1 change: 1 addition & 0 deletions src/Artefact-Core-Tests/PDFHorizontalLayoutTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Class {
{ #category : #running }
PDFHorizontalLayoutTest >> setUp [

super setUp.
testLayout := PDFHorizontalLayout new
]

Expand Down
1 change: 1 addition & 0 deletions src/Artefact-Core-Tests/PDFLayoutTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Class {
{ #category : #running }
PDFLayoutTest >> setUp [

super setUp.
testLayout := PDFDummyLayout new.
generator := PDFGenerator new.
page := PDFPage new.
Expand Down
13 changes: 11 additions & 2 deletions src/Artefact-Core-Tests/PDFParagraphTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PDFParagraphTest >> paragraph: anObject [
{ #category : #running }
PDFParagraphTest >> setUp [

super setUp.
self doc: PDFDocument new.
self page: PDFPage new.

Expand All @@ -62,6 +63,14 @@ PDFParagraphTest >> setUp [
self doc generate
]

{ #category : #running }
PDFParagraphTest >> tearDown [
{ #category : #tests }
PDFParagraphTest >> testDimensions [

self assert: paragraph dimension equals: 160mm@60mm
]

{ #category : #tests }
PDFParagraphTest >> testOrigin [

self assert: paragraph from equals: 10 mm @ 10 mm
]
4 changes: 2 additions & 2 deletions src/Artefact-Core/PDFBasic.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PDFBasic >> determinePosition: aPosition on: aPage [
PDFBasic >> generateCodeSegmentWith: aPDFGenerator styleSheet: aStyleSheet format: aFormat [

^ self codeSegmentClass
code: (self producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet)
code: (self producePageElementCodeWith: aPDFGenerator styleSheet: aStyleSheet)
styleSheet: aStyleSheet
format: aFormat
isDrawElement: self isDrawElement
Expand All @@ -56,7 +56,7 @@ PDFBasic >> opacity: anOpacity [
]

{ #category : #render }
PDFBasic >> producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet [
PDFBasic >> producePageElementCodeWith: aPDFGenerator styleSheet: aStyleSheet [

self subclassResponsibility
]
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFBezierCurveElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PDFBezierCurveElement >> points: anObject [
]

{ #category : #render }
PDFBezierCurveElement >> producePageElementCodeWith: aPDFGenerator StyleSheet: anObject [
PDFBezierCurveElement >> producePageElementCodeWith: aPDFGenerator styleSheet: anObject [
"Draw a Bezier curve from xy to destination (3 control points)"

^ String
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFCircleElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PDFCircleElement class >> center: aPoint radius: aRadius [
]

{ #category : #render }
PDFCircleElement >> producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet [
PDFCircleElement >> producePageElementCodeWith: aPDFGenerator styleSheet: aStyleSheet [
"Draw a line from xy to destination"

| origin r |
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFEllipseElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PDFEllipseElement class >> center: aPoint radius: aRadius [
]

{ #category : #render }
PDFEllipseElement >> producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet [
PDFEllipseElement >> producePageElementCodeWith: aPDFGenerator styleSheet: aStyleSheet [

| hw hh magic cx cy lx rx ty by |

Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFImage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ PDFImage >> originalImageDimensions [
]

{ #category : #render }
PDFImage >> producePageElementCodeWith: aPDFGenerator StyleSheet: anObject [
PDFImage >> producePageElementCodeWith: aPDFGenerator styleSheet: anObject [
| origin imageId |

"Determine the vertical position of the image"
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFLineElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PDFLineElement class >> from: from angle: angle length: aLength [
]

{ #category : #render }
PDFLineElement >> producePageElementCodeWith: aPDFGenerator StyleSheet: anObject [
PDFLineElement >> producePageElementCodeWith: aPDFGenerator styleSheet: anObject [

| dest |
dest := aPDFGenerator determinePositionOnCurrentPage: self orientedTo .
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFPolygonElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PDFPolygonElement >> points: anObject [
]

{ #category : #render }
PDFPolygonElement >> producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet [
PDFPolygonElement >> producePageElementCodeWith: aPDFGenerator styleSheet: aStyleSheet [
"Draw a polygon from xy to destination (a array of positions)"

^ String
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFRectElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Class {
}

{ #category : #render }
PDFRectElement >> producePageElementCodeWith: aPDFGenerator StyleSheet: aStyleSheet [
PDFRectElement >> producePageElementCodeWith: aPDFGenerator styleSheet: aStyleSheet [
"Draw a rectangle from xy with a specified dimension"

| position |
Expand Down
2 changes: 1 addition & 1 deletion src/Artefact-Core/PDFTextElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PDFTextElement >> minimumDimensionWith: aPDFGenerator styleSheet: aStyleSheet [
]

{ #category : #render }
PDFTextElement >> producePageElementCodeWith: aGenerator StyleSheet: aStyleSheet [
PDFTextElement >> producePageElementCodeWith: aGenerator styleSheet: aStyleSheet [
"Draw a text at xy position"

| position |
Expand Down

0 comments on commit 45a5b46

Please sign in to comment.