00-initial-env.test 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ;;;; 00-initial-env.test --- Roots. -*- mode: scheme; coding: utf-8; -*-
  2. ;;;;
  3. ;;;; Copyright (C) 2010 Free Software Foundation, Inc.
  4. ;;;;
  5. ;;;; This library is free software; you can redistribute it and/or
  6. ;;;; modify it under the terms of the GNU Lesser General Public
  7. ;;;; License as published by the Free Software Foundation; either
  8. ;;;; version 3 of the License, or (at your option) any later version.
  9. ;;;;
  10. ;;;; This library is distributed in the hope that it will be useful,
  11. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. ;;;; Lesser General Public License for more details.
  14. ;;;;
  15. ;;;; You should have received a copy of the GNU Lesser General Public
  16. ;;;; License along with this library; if not, write to the Free Software
  17. ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. (define-module (the-initial-env)
  19. #:use-module (test-suite lib))
  20. ;;; A set of tests to run early. The file name is to have `check-guile' pick
  21. ;;; this test file first.
  22. ;;;
  23. ;;; Tests to be run when GOOPS is not loaded.
  24. ;;;
  25. (with-test-prefix "goopsless"
  26. (with-test-prefix/c&e "+ wrong type argument"
  27. ;; The following tests assume that `+' hasn't been turned into a generic
  28. ;; and extended. Since the ECMAScript run-time library does exactly
  29. ;; that, they must be run before `ecmascript.test'.
  30. (pass-if-exception "1st argument string"
  31. exception:wrong-type-arg
  32. (+ "1" 2))
  33. (pass-if-exception "2nd argument bool"
  34. exception:wrong-type-arg
  35. (+ 1 #f))
  36. (pass-if-exception "implicit forcing is not supported"
  37. exception:wrong-type-arg
  38. (+ (delay (* 3 7)) 13)))
  39. (with-test-prefix/c&e "- wrong type argument"
  40. ;; Same for `-'.
  41. (pass-if-exception "1st argument string"
  42. exception:wrong-type-arg
  43. (+ "1" 2))
  44. (pass-if-exception "2nd argument symbol"
  45. exception:wrong-type-arg
  46. (+ 1 'bar))))