Skip to content

Commit

Permalink
Add Datatype tests coming from SpriteHorn doodles
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Oct 13, 2024
1 parent 788526b commit 47e4476
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/SpriteLang-Tests/SpriteHornNegTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,56 @@ SpriteHornNegTest >> testL6maxlist01 [
'
]

{ #category : #'tests-L8' }
SpriteHornNegTest >> testL8uniqueVoid2Constructors [
self proveNeg: '
(data V 0 = [
| One {}
| Two {}
])
(constraint
(forall ((a V) (Bool true))
(forall ((b V) (Bool true))
((a === b)))))
'
]

{ #category : #'tests-L8' }
SpriteHornNegTest >> testL8uniqueVoidNoADT [
self proveNeg: '
(constraint
(forall ((a `v) (Bool true))
(forall ((b `v) (Bool true))
((a === b)))))
'
]

{ #category : #'tests-L8' }
SpriteHornNegTest >> testL8uniqueVoidParam [
self proveNeg: '
(data V 0 = [
| One {Cons0 : int}
])
(constraint
(forall ((a V) (Bool true))
(forall ((b V) (Bool true))
((a === b)))))
'
]

{ #category : #'tests-L8' }
SpriteHornNegTest >> testL8uniqueVoidParamPoly [
self proveNeg: '
(data V 1 = [
| One {Cons0 : @(0)}
])
(constraint
(forall ((a (V int)) (Bool true))
(forall ((b (V int)) (Bool true))
((a === b)))))
'
]
51 changes: 51 additions & 0 deletions src/SpriteLang-Tests/SpriteHornPosTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,42 @@ SpriteHornPosTest >> testL5tuple00 [

]

{ #category : #'tests-L5' }
SpriteHornPosTest >> testL5tuple00L8 [
self provePos: '
IMPLEMENT ME; the Fixpoint Doodle is already pushed.
'

]

{ #category : #'tests-L5' }
SpriteHornPosTest >> testL5tuple00L8poly [
self provePos: '
(var $k1 ((int) (int) ((C int int)) (int) (int)))
(data C 2 = [
| C {C0 : @(0), C1 : @(1)}
])
(constraint
(and
(forall ((n int) (Bool true))
(forall ((n1 int) (n+1 === n1))
(forall ((v int) ((n+1 === v) & (v === n1))) ((n < v)))))
(forall ((m int) (Bool true))
(forall ((p (C int int)) (Bool true))
(forall ((px int) (Bool true))
(forall ((py int) (px < py))
(forall ((p (C int int)) (Bool true))
(and
(forall ((VV int) (VV === px)) (($k1 VV m p px py)))
(forall ((v int) ((px < v) & (v === py))) (($k1 v m p px py)))
(forall ((ok bool) (ok <=> (px < py)))
(forall ((v bool) ((v <=> (px < py)) & (v === ok))) ((v))))))))))))
'

]

{ #category : #'tests-L6' }
SpriteHornPosTest >> testL6compose00 [
self provePos: '
Expand Down Expand Up @@ -1663,3 +1699,18 @@ SpriteHornPosTest >> testL8uniqueVoid [
((a === b)))))
'
]

{ #category : #'tests-L8' }
SpriteHornPosTest >> testL8uniqueVoidExplicitDistinction [
self provePos: '
(data V 0 = [
| One {}
| Two {}
])
(constraint
(forall ((a V) (a === One))
(forall ((b V) (b === One))
((a === b)))))
'
]

0 comments on commit 47e4476

Please sign in to comment.