;; -*-theme-d-*-

;; Copyright (C) 2018  Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.

;; Expected results: translation and running OK

(define-proper-program (tests test680)

  (import (standard-library core)
	  (standard-library math)
	  (standard-library console-io)
	  (tests numerical-test-env))

  (define-simple-proc main (() <none> nonpure)
    (console-display "(/ 1 0): ")
    (guard-without-result
     (exc (else (console-display "exception ")
		(console-display exc)
		(console-newline)))
     (console-display (/ 1 0))
     (console-newline))
    (console-display "(/ 1 0/1): ")
    (guard-without-result
     (exc (else (console-display "exception ")
		(console-display exc)
		(console-newline)))
     (console-display (/ 1 (rational 0 1)))
     (console-newline))
    (report-result (/ 1 0.0))
    (report-result (/ 1 (complex 0 0)))
    (console-newline)

    (console-display "(/ 1/1 0): ")
    (guard-without-result
     (exc (else (console-display "exception ")
		(console-display exc)
		(console-newline)))
     (console-display (/ (rational 1 1) 0))
     (console-newline))
    (console-display "(/ 1/1 0/1): ")
    (guard-without-result
     (exc (else (console-display "exception ")
		(console-display exc)
		(console-newline)))
     (console-display (/ (rational 1 1) (rational 0 1)))
     (console-newline))
    (report-result (/ (rational 1 1) 0.0))
    (report-result (/ (rational 1 1) (complex 0 0)))
    (console-newline)

    (report-result (/ 1.0 0))
    (report-result (/ 1.0 0.0))
    (report-result (/ 1.0 (rational 0 1)))
    (report-result (/ 1.0 (complex 0 0)))
    (console-newline)

    (report-result (/ (complex 1.0 1.0) 0))
    (report-result (/ (complex 1.0 1.0) 0.0))
    (report-result (/ (complex 1.0 1.0) (rational 0 1)))
    (report-result (/ (complex 1.0 1.0) (complex 0 0)))
    (console-newline)))
