Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ PharoCompatibilityP13SurfacePharo12Test >> testSyntaxErrorNoticeClassName [
equals: #RBSyntaxErrorNotice
]

{ #category : 'tests' }
PharoCompatibilityP13SurfacePharo12Test >> testUndeclaredVariableNodeFromCompileWarning [

| node |
[ Object
compile: 'pharoCompatibilityBrokenMethod ^ missingCompatibilityVariable' ]
on: Exception
do: [ :error |
node := PharoCompatibility undeclaredVariableNodeFromException: error ].
self assert: node notNil.
self assert: node name equals: #missingCompatibilityVariable
]

{ #category : 'tests' }
PharoCompatibilityP13SurfacePharo12Test >> testWithNonInteractiveAuthorUsesAuthorWhenNoAuthorIsConfigured [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ PharoCompatibilityP13SurfacePharo14Test >> testSyntaxErrorNoticeClassName [
equals: #OCSyntaxErrorNotice
]

{ #category : 'tests' }
PharoCompatibilityP13SurfacePharo14Test >> testSyntaxNoticeFromCodeError [

| compiler notice |
compiler := SmalltalkImage current compiler.
compiler compilationContext isScripting: true.
[ compiler evaluate: '1 +' ]
on: Exception
do: [ :error |
notice := PharoCompatibility syntaxNoticeFromException: error ].
self assert: notice notNil.
self assert: notice class name equals: #OCSyntaxErrorNotice
]

{ #category : 'tests' }
PharoCompatibilityP13SurfacePharo14Test >> testUndeclaredVariableNodeFromCompilationError [

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : 'OCCodeError' }

{ #category : '*PharoCompatibility-Pharo13Surface-Pharo14' }
OCCodeError >> pharoCompatibilitySyntaxNotice [

^ self notice
]

{ #category : '*PharoCompatibility-Pharo13Surface-Pharo14' }
OCCodeError >> pharoCompatibilityUndeclaredVariableNode [

^ self notice ifNotNil: [ :syntaxNotice |
syntaxNotice pharoCompatibilityUndeclaredVariableNode ]
]
Loading