-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
repository/ViennaTalk-Parser-Tests/ViennaMapDomainRestrictedByNodeTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
" | ||
A ViennaMapDomainRestrictedByNodeTest is a test class for testing the behavior of ViennaMapDomainRestrictedByNode | ||
" | ||
Class { | ||
#name : #ViennaMapDomainRestrictedByNodeTest, | ||
#superclass : #TestCase, | ||
#category : #'ViennaTalk-Parser-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
ViennaMapDomainRestrictedByNodeTest >> testTypecheck [ | ||
|
||
| expr | | ||
expr := 's <-: m' asViennaExpressionAst. | ||
|
||
expr expression1 maximalType: ViennaType nat set. | ||
expr expression2 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
self | ||
assert: (expr typecheck: (ViennaType nat mapTo: ViennaType char)) | ||
equals: (ViennaType nat mapTo: ViennaType char). | ||
expr expression1 maximalType: ViennaType nat optional set. | ||
expr expression2 maximalType: | ||
(ViennaType real mapTo: ViennaType char). | ||
self | ||
assert: (expr typecheck: (ViennaType real mapTo: ViennaType char)) | ||
equals: (ViennaType real mapTo: ViennaType char). | ||
expr expression1 maximalType: ViennaType char set. | ||
expr expression2 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
self | ||
should: [ expr typecheck: (ViennaType real mapTo: ViennaType char) ] | ||
raise: ViennaTypeError | ||
] |
29 changes: 29 additions & 0 deletions
29
repository/ViennaTalk-Parser-Tests/ViennaMapDomainRestrictedToNodeTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Class { | ||
#name : #ViennaMapDomainRestrictedToNodeTest, | ||
#superclass : #TestCase, | ||
#category : #'ViennaTalk-Parser-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
ViennaMapDomainRestrictedToNodeTest >> testTypecheck [ | ||
|
||
| expr | | ||
expr := 's <: m' asViennaExpressionAst. | ||
|
||
expr expression1 maximalType: ViennaType nat set. | ||
expr expression2 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
self | ||
assert: (expr typecheck: (ViennaType nat mapTo: ViennaType char)) | ||
equals: (ViennaType nat mapTo: ViennaType char). | ||
expr expression1 maximalType: ViennaType nat optional set. | ||
expr expression2 maximalType: | ||
(ViennaType real mapTo: ViennaType char). | ||
self | ||
assert: (expr typecheck: (ViennaType real mapTo: ViennaType char)) | ||
equals: (ViennaType real mapTo: ViennaType char). | ||
expr expression1 maximalType: ViennaType char set. | ||
expr expression2 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
self | ||
should: [ expr typecheck: (ViennaType real mapTo: ViennaType char) ] | ||
raise: ViennaTypeError | ||
] |
38 changes: 38 additions & 0 deletions
38
repository/ViennaTalk-Parser-Tests/ViennaMapMergeNodeTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
" | ||
A ViennaMapMergeNodeTest is a test class for testing the behavior of ViennaMapMergeNode | ||
" | ||
Class { | ||
#name : #ViennaMapMergeNodeTest, | ||
#superclass : #TestCase, | ||
#category : #'ViennaTalk-Parser-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
ViennaMapMergeNodeTest >> testTypecheck [ | ||
|
||
| expr | | ||
expr := 'm1 munion m2' asViennaExpressionAst. | ||
|
||
expr expression1 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
expr expression2 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
self | ||
assert: (expr typecheck: (ViennaType nat mapTo: ViennaType char)) | ||
equals: (ViennaType nat mapTo: ViennaType char). | ||
|
||
expr expression1 maximalType: | ||
(ViennaType nat optional mapTo: ViennaType char). | ||
expr expression2 maximalType: | ||
(ViennaType nat mapTo: ViennaType char optional). | ||
self | ||
assert: (expr typecheck: | ||
(ViennaType nat optional mapTo: ViennaType char optional)) | ||
equals: (ViennaType nat optional mapTo: ViennaType char optional). | ||
|
||
expr expression1 maximalType: (ViennaType nat mapTo: ViennaType char). | ||
expr expression2 maximalType: (ViennaType char mapTo: ViennaType nat). | ||
self | ||
assert: (expr typecheck: (ViennaType nat | ViennaType char mapTo: | ||
ViennaType nat | ViennaType char)) | ||
equals: (ViennaType nat | ViennaType char mapTo: | ||
ViennaType char | ViennaType nat) | ||
] |