]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/alien/c-types/c-types-tests.factor
alien.c-types: not necessary to import `short` differently anymore
[factor.git] / basis / alien / c-types / c-types-tests.factor
index 04a18dbb70e8141d998e33da3e4d23f10c89925d..b13faf45c72cf4f819a4464e35ec42ffd6c0370d 100644 (file)
@@ -1,7 +1,6 @@
 USING: accessors alien.c-types alien.syntax classes
 classes.struct compiler.units eval io.encodings.ascii kernel
 math.constants tools.test ;
-FROM: alien.c-types => short ;
 IN: alien.c-types.tests
 
 CONSTANT: xyz 123
@@ -59,6 +58,23 @@ C-TYPE: opaque
 { t } [ void* lookup-c-type pointer: opaque lookup-c-type = ] unit-test
 [ opaque lookup-c-type ] [ no-c-type? ] must-fail-with
 
+! c-type-string
+{
+    "c-string[ascii]"
+    "foo*"
+    "int[5]"
+    "int**"
+    "MyFunkyString*"
+    "opaque*"
+} [
+    { c-string ascii } c-type-string
+    pointer: foo c-type-string
+    { int 5 } c-type-string
+    pointer: pointer: int c-type-string
+    pointer: MyFunkyString c-type-string
+    pointer: opaque c-type-string
+] unit-test
+
 [ "
     USING: alien.syntax ;
     IN: alien.c-types.tests