<commit_before>Class {
	#name : #PRRichTextWriterTest,
	#superclass : #TestCase,
	#instVars : [
		'sample'
	],
	#category : #'Pillar-ExporterRichText-Tests'
}

{ #category : #asserting }
PRRichTextWriterTest >> assertWriting: aPRDocument include: expectedAttribute [
	self assert: ((self runsOf: aPRDocument) includes: expectedAttribute asArray)
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> boldFormat [
	^ TextEmphasis bold
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> externalLink: aLink [
	^ TextAction new actOnClickBlock: [WebBrowser openOn: aLink]
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> figure: aFigureLink [
	| url |
	url := aFigureLink.
	^ TextAnchor new anchoredMorph: (ZnEasy getPng: url)
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel1 [
	^ PRRichTextComposer headerLevelFont: 1
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel2 [
	^ PRRichTextComposer headerLevelFont: 2
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel3 [
	^ PRRichTextComposer headerLevelFont: 3
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel4 [
	^ PRRichTextComposer headerLevelFont: 4
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel5 [
	^ PRRichTextComposer headerLevelFont: 5
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel6 [
	^ PRRichTextComposer headerLevelFont: 6
]

{ #category : #initialization }
PRRichTextWriterTest >> initialize [
	sample := PRDocumentSample new.
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> italicFormat [
	^ TextEmphasis italic
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> monospaceFormat [
	^ TextBackgroundColor color: Smalltalk ui theme settings windowColor
]

{ #category : #asserting }
PRRichTextWriterTest >> runsOf: aPRDocument [
	^ (PRRichTextComposer new start: aPRDocument) runs
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> strikethroughtFormat [
	^ TextEmphasis struckOut
]

{ #category : #asserting }
PRRichTextWriterTest >> stringOf: aPRDocument [
	^ (PRRichTextComposer new start: aPRDocument) string
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> subscriptFormat [
	^ TextColor red
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> superscriptFormat [
	^ TextColor blue<commit_msg>Initialize becomes setUp<commit_after>Class {
	#name : #PRRichTextWriterTest,
	#superclass : #TestCase,
	#instVars : [
		'sample'
	],
	#category : #'Pillar-ExporterRichText-Tests'
}

{ #category : #asserting }
PRRichTextWriterTest >> assertWriting: aPRDocument include: expectedAttribute [
	self assert: ((self runsOf: aPRDocument) includes: expectedAttribute asArray)
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> boldFormat [
	^ TextEmphasis bold
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> externalLink: aLink [
	^ TextAction new actOnClickBlock: [WebBrowser openOn: aLink]
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> figure: aFigureLink [
	| url |
	url := aFigureLink.
	^ TextAnchor new anchoredMorph: (ZnEasy getPng: url)
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel1 [
	^ PRRichTextComposer headerLevelFont: 1
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel2 [
	^ PRRichTextComposer headerLevelFont: 2
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel3 [
	^ PRRichTextComposer headerLevelFont: 3
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel4 [
	^ PRRichTextComposer headerLevelFont: 4
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel5 [
	^ PRRichTextComposer headerLevelFont: 5
]

{ #category : #'tests - Header' }
PRRichTextWriterTest >> headerLevel6 [
	^ PRRichTextComposer headerLevelFont: 6
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> italicFormat [
	^ TextEmphasis italic
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> monospaceFormat [
	^ TextBackgroundColor color: Smalltalk ui theme settings windowColor
]

{ #category : #asserting }
PRRichTextWriterTest >> runsOf: aPRDocument [
	^ (PRRichTextComposer new start: aPRDocument) runs
]

{ #category : #initialization }
PRRichTextWriterTest >> setUp [
	super setUp.
	sample := PRDocumentSample new.
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> strikethroughtFormat [
	^ TextEmphasis struckOut
]

{ #category : #asserting }
PRRichTextWriterTest >> stringOf: aPRDocument [
	^ (PRRichTextComposer new start: aPRDocument) string
]

{ #category : #'skipped tests' }
PRRichTextWriterTest >> subscriptFormat [
	^ TextColor red
]

{ #category : #'tests - Format' }
PRRichTextWriterTest >> superscriptFormat [
	^ TextColor blue
{'fraction_non_alphanumeric': 0.11903765690376569, 'fraction_numerical': 0.00502092050209205, 'mean_word_length': 5.299077733860343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4330005', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1567, 'n_words': 349}