diff --git a/src/SpriteLang-Tests/SpriteDataNegTest.class.st b/src/SpriteLang-Tests/SpriteDataNegTest.class.st new file mode 100644 index 000000000..9d2a888bc --- /dev/null +++ b/src/SpriteLang-Tests/SpriteDataNegTest.class.st @@ -0,0 +1,24 @@ +Class { + #name : #SpriteDataNegTest, + #superclass : #SpriteLangNegTest, + #category : #'SpriteLang-Tests-Simple' +} + +{ #category : #tests } +SpriteDataNegTest >> test_TwoIsNotTerminal [ + self processString: ' +type two = + | A + | B + ; + +⟦val cassert : bool[b|b] => int⟧ +let cassert = (b) => { 0 }; + +⟦val main : two => two => int⟧ +let main = (x, y) => { + let ok = x == y; + cassert(ok) +}; +' +] diff --git a/src/SpriteLang-Tests/SpriteDataPosTest.class.st b/src/SpriteLang-Tests/SpriteDataPosTest.class.st new file mode 100644 index 000000000..b19bcee6a --- /dev/null +++ b/src/SpriteLang-Tests/SpriteDataPosTest.class.st @@ -0,0 +1,23 @@ +Class { + #name : #SpriteDataPosTest, + #superclass : #SpriteLangPosTest, + #category : #'SpriteLang-Tests-Simple' +} + +{ #category : #tests } +SpriteDataPosTest >> test_VoidIsTerminal [ + self processString: ' +type void = + | Nil + ; + +⟦val cassert : bool[b|b] => int⟧ +let cassert = (b) => { 0 }; + +⟦val main : void => void => int⟧ +let main = (x, y) => { + let ok = x == y; + cassert(ok) +}; +' +]