~ chicken-core (chicken-5) /tests/executable-tests.scm
Trap1;;; Compiled executable tests23(include "test.scm")45(import (chicken file)6 (chicken file posix)7 (chicken pathname)8 (chicken process-context)9 (chicken string))1011(define program-path12 (cond-expand13 ((and windows (not cygwin))14 (string-translate (car (command-line-arguments)) "/" "\\"))15 (else (car (command-line-arguments)))))1617(define (read-symbolic-link* p)18 (cond-expand19 ((and windows (not cygwin)) p)20 (else (read-symbolic-link p #t))))2122(test-begin "executable tests")2324(let ((p (program-name)))25 (test-equal "program-name"26 (pathname-strip-directory p)27 (pathname-strip-directory program-path)))2829(and-let* ((p (executable-pathname)))30 (test-equal "executable-pathname"31 (read-symbolic-link* p)32 (read-symbolic-link* program-path)))3334(test-end)3536(test-exit)