;; -*-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 test677)

  (import (standard-library core)
	  (standard-library rational)
	  (standard-library console-io))

  (define-simple-proc my-print (((rat <rational-number>)) <none> nonpure)
    (console-display-line rat))

  (define-simple-proc do-tests
      (((rat1 <rational-number>) (rat2 <rational-number>)) <none> nonpure)
    (my-print (+ rat1 rat2))
    (my-print (- rat1 rat2))
    (my-print (* rat1 rat2))
    (my-print (/ rat1 rat2))
    (my-print (- rat1))
    (my-print (abs rat1))
    (my-print (square rat1))
    (console-display-line (< rat1 rat2))
    (console-display-line (<= rat1 rat2))
    (console-display-line (> rat1 rat2))
    (console-display-line (>= rat1 rat2))
    (console-display-line (equal? rat1 rat2)))

  (define-simple-proc main (() <none> nonpure)
    (do-tests (rational 1 3) (rational -2 5))))
