Chicken fixes

This commit is contained in:
retropikzel 2025-07-10 07:41:50 +03:00
parent 71ed0ef352
commit 194c4c62bc
2 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ test: tmp/test/libtest.o tmp/test/libtest.so tmp/test/libtest.a
COMPILE_R7RS_KAWA="-J--add-exports=java.base/jdk.internal.foreign.abi=ALL-UNNAMED -J--add-exports=java.base/jdk.internal.foreign.layout=ALL-UNNAMED -J--add-exports=java.base/jdk.internal.foreign=ALL-UNNAMED -J--enable-native-access=ALL-UNNAMED -J--enable-preview" \
COMPILE_R7RS=${SCHEME} \
compile-r7rs -I . -I /usr/local/share/kawa/lib -o ${TEST} ${TEST}.scm
cd tmp/test && ./${TEST}
cd tmp/test && LD_LIBRARY_PATH=. ./${TEST}
test-compile-r7rs-snow: tmp/test/libtest.o tmp/test/libtest.so tmp/test/libtest.a
cp tests/*.scm tmp/test/

View File

@ -328,11 +328,11 @@
(define output-file (c-fopen (string->c-utf8 "testfile.test")
(string->c-utf8 "w")))
(debug output-file)
(define-c-procedure c-fprintf libc 'fprintf 'int '(pointer pointer))
(define-c-procedure c-fprintf libc 'fprintf 'int '(pointer pointer int))
(define characters-written
(c-fprintf output-file (string->c-utf8 "Hello world")))
(c-fprintf output-file (string->c-utf8 "Hello world %i") 1))
(debug characters-written)
(assert equal? (= characters-written 11) #t)
(assert equal? (= characters-written 13) #t)
(define-c-procedure c-fclose libc 'fclose 'int '(pointer))
(define closed-status (c-fclose output-file))
(debug closed-status)
@ -340,6 +340,6 @@
(assert equal? (file-exists? "testfile.test") #t)
(assert equal? (string=? (with-input-from-file "testfile.test"
(lambda () (read-line)))
"Hello world") #t)
"Hello world 1") #t)
(exit 0)