Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing tests for regeneration of hierarchy #802

Merged
merged 2 commits into from
Aug 26, 2024
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
40 changes: 40 additions & 0 deletions src/Famix-Test9-Tests/FamixTest9Test.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Class {
#name : #FamixTest9Test,
#superclass : #TestCase,
#category : #'Famix-Test9-Tests'
}

{ #category : #running }
FamixTest9Test >> tearDown [

FamixTest9Generator deleteMetaModel.
super tearDown
]

{ #category : #tests }
FamixTest9Test >> testRegenerationWithSlightDifferencesFromScratchWorks [

"We generate the meta-model"
FamixTest9Generator generate.

"We remove it entirely, and we generate a slightly different version of it"
FamixTest9Generator deleteMetaModel.
FamixTest9BisGenerator generate.

self assert: ((self class environment at: #FamixTest9MySubclass) definesSlotNamed: #mySuperclass).
self assert: ((self class environment at: #FamixTest9MySuperclass) definesSlotNamed: #mySubclasses)
]

{ #category : #tests }
FamixTest9Test >> testRegenerationWithSlightDifferencesRedefinesRelation [
"This is a smoke test checking that generation does not fail"

"We generate the meta-model"

FamixTest9Generator generate.

FamixTest9BisGenerator generate.

self assert: ((self class environment at: #FamixTest9MySubclass) definesSlotNamed: #mySuperclass).
self assert: ((self class environment at: #FamixTest9MySuperclass) definesSlotNamed: #mySubclasses)
]
1 change: 1 addition & 0 deletions src/Famix-Test9-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Famix-Test9-Tests' }
Loading