tests.at: Use the `@%:@' quadrigraph rather than quoting hacks for `#'.
[runlisp] / tests.at
index d769420..b022076 100644 (file)
--- a/tests.at
+++ b/tests.at
@@ -54,14 +54,14 @@ lisp=$1
 LISP=$m4_translit(m4_bpatsubst([$1], [/.*$], []), [a-z], [A-Z])
 AT_SKIP_IF([test "x$LISP" = x])
 case $lisp in
-  */*) opt=${lisp#*/} lisp=${lisp%%/*} ;;
+  */*) opt=${lisp@%:@*/} lisp=${lisp%%/*} ;;
   *) opt="" ;;
 esac
 case /$opt/ in */noimage/*) RUNLISP_IMAGEDIR=./notexist ;; esac])
 
 m4_define([WHICH_LISP],
-[(or #+sbcl "sbcl" #+ccl "ccl" #+clisp "clisp"
-     #+ecl "ecl" #+cmu "cmucl" #+abcl "abcl"
+[(or @%:@+sbcl "sbcl" @%:@+ccl "ccl" @%:@+clisp "clisp"
+     @%:@+ecl "ecl" @%:@+cmu "cmucl" @%:@+abcl "abcl"
      "unknown")])
 
 m4_define([NL], [
@@ -96,13 +96,13 @@ HOME=$(pwd)/HOME; export HOME
 
 ## Prepare the script.
 cat >test-script <<EOF
-[#!] RUNLISP_PATH -L$lisp
+@%:@! RUNLISP_PATH -L$lisp
 
 ;; Print a greeting to \`*standard-output*', identifying the Lisp system, so
 ;; that we can tell whether we called the right one.
 (format t "Hello from ~A (~A)!~%" (lisp-implementation-type) WHICH_LISP)
 
-#! this should be a comment everywhere
+@%:@! this should be a comment everywhere
 
 ;; Make sure that \`*error-output*' is hooked up properly.
 (format *error-output* "to stderr~%")
@@ -120,12 +120,12 @@ cat >test-script <<EOF
 ;; ourselves.  Alas, ABCL and ECL pollute \`cl-user' out of the box.  (ECL
 ;; does this deliberately; ABCL's ``adjoin.lisp' lacks an \`in-package'
 ;; form.)
-(let ((#1=#:syms (sort (loop :for #2=#:s :being :the :present-symbols
-                              :of *package*
-                            :collect #2#)
-                      #'string<)))
+(let ((@%:@1=@%:@:syms (sort (loop :for @%:@2=@%:@:s :being
+                              :the :present-symbols :of *package*
+                            :collect @%:@2@%:@)
+                      @%:@'string<)))
   (format t "package \`~A' [~:[ok~;has unexpected symbols ~:*~S~]]~%"
-         (package-name *package*) #1#))
+         (package-name *package*) @%:@1@%:@))
 
 ;; Print the program name and command-line arguments.
 (format t "program name = ~S~%~
@@ -177,7 +177,7 @@ PREPARE_LISP_TEST([$1])
 
 ## A simple script which signals an error without catching it.
 cat >test <<EOF
-[#!] RUNLISP_PATH -L$lisp
+@%:@! RUNLISP_PATH -L$lisp
 (error "just kill me now")
 EOF
 chmod +x test
@@ -210,7 +210,7 @@ AT_CHECK([RUNLISP_PATH -e '(format t "Just another Lisp hacker!~%")'],,
 
 ## The `:runlisp-script' keyword should /not/ be in `*features*'.
 traceon
-AT_CHECK([RUNLISP_PATH -p '(find :runlisp-script *features*)'],, [NIL
+AT_CHECK([RUNLISP_PATH -d '(find :runlisp-script *features*)'],, [NIL
 ])
 
 ## Check a mixture of all the kinds of evaluation.  We'll need a stunt script
@@ -218,25 +218,31 @@ AT_CHECK([RUNLISP_PATH -p '(find :runlisp-script *features*)'],, [NIL
 ## evaluated one at a time, so that each one can affect the way the reader
 ## interprets the next.
 cat >script.lisp <<EOF
-#! just want to check that Lisp doesn't choke on a shebang line here
+@%:@! just want to check that Lisp doesn't choke on a shebang line here
 (format t "And we're running the script...~%~
           Command-line arguments: ~:S~%~
           Symbols in package \`~A': ~:S~%"
        uiop:*command-line-arguments*
        (package-name *package*)
-       (sort (loop :for #2=#:s :being :the :present-symbols :of *package*
-                   :collect #2#)
-             #'string<))
+       (sort (loop :for @%:@2=@%:@:s :being
+                     :the :present-symbols :of *package*
+                   :collect @%:@2@%:@)
+             @%:@'string<))
 EOF
 AT_CHECK([RUNLISP_PATH \
-           -e '(defpackage [#:]runlisp-test (:export [#:]foo))
-               (defvar runlisp-test:foo 1)' \
-           -p runlisp-test:foo \
+           -e '(defpackage @%:@:runlisp-test (:export @%:@:foo @%:@:bar))
+               (defvar runlisp-test:foo 1)
+               (defvar runlisp-test:bar "stoat!")' \
+           -d runlisp-test:foo \
+           -d runlisp-test:bar \
+           -p runlisp-test:bar \
            -e '(incf runlisp-test:foo)' \
            -l script.lisp \
-           -p runlisp-test:foo \
+           -d runlisp-test:foo \
            -- -e one two three],,
 [1
+"stoat!"
+stoat!
 And we're running the script...
 Command-line arguments: ("-e" "one" "two" "three")
 Symbols in package `COMMON-LISP-USER': ()
@@ -258,7 +264,7 @@ SETUP_RUNLISP_ENV
 unset lisp0 lisp1 badlisp; win=nil
 set -- cmucl sbcl ccl clisp ecl abcl
 while :; do
-  case $# in 0) break ;; esac
+  case $@%:@ in 0) break ;; esac
   lisp=$1; shift
   if RUNLISP_PATH -L$lisp -enil 2>/dev/null; then good=t; else good=nil; fi
   case ${lisp0+t},${badlisp+t},$good in
@@ -277,10 +283,10 @@ echo Secondary Lisp = $lisp1
 echo Bad Lisp = $badlisp
 
 ## Check that our selection worked.
-AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp0 -p 'WHICH_LISP'],, ["$lisp0"NL])
-AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp1 -p 'WHICH_LISP'],, ["$lisp1"NL])
-AT_CHECK([RUNLISP_PATH -L$badlisp -p 'WHICH_LISP'], [127],,
-[runlisp: no acceptable Lisp systems found[]NL])
+AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp0 -d 'WHICH_LISP'],, ["$lisp0"NL])
+AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp1 -d 'WHICH_LISP'],, ["$lisp1"NL])
+AT_CHECK([RUNLISP_PATH -L$badlisp -d 'WHICH_LISP'], [127],,
+        [runlisp: no acceptable Lisp systems found[]NL])
 
 ## Unset all of the user preference mechanisms.
 here=$(pwd)
@@ -288,16 +294,16 @@ mkdir HOME config
 HOME=$here/HOME XDG_CONFIG_HOME=$here/config; export HOME XDG_CONFIG_HOME
 
 ## We generally take the first one listed that exists.
-AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp0,$lisp1 -p 'WHICH_LISP'],, ["$lisp0"NL])
-AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp1,$lisp0 -p 'WHICH_LISP'],, ["$lisp1"NL])
-AT_CHECK_UNQUOTED([RUNLISP_PATH -L$badlisp,$lisp0,$lisp1 -p 'WHICH_LISP'],,
+AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp0,$lisp1 -d 'WHICH_LISP'],, ["$lisp0"NL])
+AT_CHECK_UNQUOTED([RUNLISP_PATH -L$lisp1,$lisp0 -d 'WHICH_LISP'],, ["$lisp1"NL])
+AT_CHECK_UNQUOTED([RUNLISP_PATH -L$badlisp,$lisp0,$lisp1 -d 'WHICH_LISP'],,
                  ["$lisp0"NL])
 
 ## Check parsing of embedded options.
 for i in 0 1; do
   j=$(( 1 - $i )); eval lisp=\$lisp$i olisp=\$lisp$j
   cat >script$i <<EOF
-[#!] RUNLISP_PATH
+@%:@! RUNLISP_PATH
 ;;; -z @RUNLISP: -L$lisp -*- -z -*- -L$olisp -- -z
 (prin1 WHICH_LISP) (terpri)
 EOF
@@ -334,7 +340,16 @@ EOF
   rm -f $conf
 done
 
+AT_CLEANUP
+
+###--------------------------------------------------------------------------
+### Implementation-specific tests.
+
+AT_SETUP([specific sbcl])
+AT_KEYWORDS([specific sbcl])
+PREPARE_LISP_TEST([sbcl])
 
+AT_CHECK([RUNLISP_PATH -e"(require 'sb-bsd-sockets)"])
 
 AT_CLEANUP