class: RegressionTests::ParserTests
authorClaus Gittinger <cg@exept.de>
Sat, 01 Mar 2014 18:52:23 +0100
changeset 1089 15d90e8a7447
parent 1088 af23fcd82a35
child 1090 744e2af469bb
class: RegressionTests::ParserTests added: #testSTX_ffiCall_01_cdecl #testSTX_ffiCall_02_api #testSTX_ffiCall_03_c #testSTX_ffiCall_04_undefinedClasses
ParserTests.st
--- a/ParserTests.st	Sat Mar 01 18:52:07 2014 +0100
+++ b/ParserTests.st	Sat Mar 01 18:52:23 2014 +0100
@@ -1303,6 +1303,59 @@
     "Modified: / 12-12-2009 / 22:08:24 / pp <Pavel.Pospichal@gmail.com>"
 ! !
 
+!ParserTests methodsFor:'tests - external functions STX'!
+
+testSTX_ffiCall_01_cdecl
+    |s p|
+
+    s := '<cdecl: char* ''ffiPrintString'' (char *)>'.
+    p := Parser new.
+    p source:s.
+    p nextToken.
+    p parsePrimitiveOrResourceSpecOrEmpty.
+!
+
+testSTX_ffiCall_02_api
+    |s p|
+
+    s := '<api: char* ''ffiPrintString'' (char *)>'.
+    p := Parser new.
+    p source:s.
+    p nextToken.
+    p parsePrimitiveOrResourceSpecOrEmpty.
+!
+
+testSTX_ffiCall_03_c
+    |s p|
+
+    s := '<C: char* >'.
+    p := Parser new.
+    p source:s.
+    p nextToken.
+    p parsePrimitiveOrResourceSpecOrEmpty.
+!
+
+testSTX_ffiCall_04_undefinedClasses
+    |b1 b2|
+
+    self should:[
+        b1 := Parser evaluate:'[ NotYetLoadedClass ]'.
+    ] raise:ParseError.
+
+    self assert:(b1 == nil).
+
+    self should:[
+        b2 := Parser evaluate:'[ NonExistingNameSpace::NotYetLoadedClass ]'.
+    ] raise:ParseError.
+
+    self assert:(b2 == nil).
+
+    "
+     self run:#test4
+     self new test4
+    "
+! !
+
 !ParserTests methodsFor:'tests - primitive'!
 
 testNewSTXPrimitive