read.test 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #! /bin/sh
  2. # -*-scheme-*-
  3. # For use as a scaffolded sexp reader test
  4. # ***REMOVE THIS BLOCK COMMENT INITIALLY***
  5. # GNU Mes --- Maxwell Equations of Software
  6. # Copyright © 2016, 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  7. #
  8. # This file is part of GNU Mes.
  9. #
  10. # GNU Mes is free software; you can redistribute it and/or modify it
  11. # under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 3 of the License, or (at
  13. # your option) any later version.
  14. #
  15. # GNU Mes is distributed in the hope that it will be useful, but
  16. # WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  22. if [ "$MES" != guile ]; then
  23. MES=${MES-$(dirname $0)/../src/mes}
  24. MES_BOOT=boot-02.scm exec $MES < $0
  25. fi
  26. exec ${MES-mes} --no-auto-compile -s $0
  27. !#
  28. (set-current-output-port (open-output-file "test/results/test101.answer"))
  29. (define (newline) (display #\newline))
  30. 0
  31. cons
  32. (cons 0 1)
  33. (display 0) (newline)
  34. #t
  35. #f
  36. (display #t) (newline)
  37. (display #f) (newline)
  38. 'foo
  39. (display 'foo) (newline)
  40. (display #o77) (newline)
  41. (display #o-6) (newline)
  42. (display #x16) (newline)
  43. (display #x-16) (newline)
  44. (display #\A) (newline)
  45. (display #\newline) (newline)
  46. #\alarm
  47. #\backspace
  48. #\tab
  49. #\newline
  50. #\vtab
  51. #\page
  52. #\return
  53. #\space
  54. (display "\"")
  55. (display "\\")
  56. (display "\\\"\"\\")
  57. (display 'foo)(newline)
  58. (display '(foo))(newline)
  59. (display '('foo))(newline)
  60. (display (cdr '(car cdr))) (newline)
  61. (display "foo bar") (newline)
  62. ;;barf
  63. #!
  64. barf
  65. !#
  66. #|
  67. burp
  68. |#
  69. #;(bla) (display "must see!\n")
  70. (display
  71. (lambda (x)
  72. #;()#t)
  73. )
  74. (display #(0 1 2)) (newline)
  75. (display (list '(foo
  76. #! boo !#
  77. ;;(bb 4)
  78. )
  79. ))
  80. (newline)
  81. (exit 0)
  82. ;; TODO: syntax, unsyntax, unsyntax-splicing