unix.ffi: Use a utility word for getting the aliases back.

db4
Doug Coleman 2014-04-22 00:29:49 -07:00
parent d1d15f83c4
commit 6be25de125
1 changed files with 5 additions and 3 deletions

View File

@ -1,10 +1,12 @@
USING: accessors alien.c-types io.encodings.utf8 kernel
sequences tools.test unix.ffi unix.utilities ;
IN: unix.ffi.tests
USING: accessors alien.c-types tools.test unix.ffi ;
[ 80 ] [ "http" f getservbyname port>> ntohs ] unit-test
[ "www" ] [
0 "http" f getservbyname aliases>> c-string alien-element
[ t ] [
0 "http" f getservbyname aliases>> utf8 alien>strings
"www" swap member?
] unit-test
[ "http" ] [ 80 htons f getservbyport name>> ] unit-test