#lang zuo

(require "harness.zuo")

(alert "cycle")

(define cycle-file (build-path tmp-dir "cycle.zuo"))

(define out (fd-open-output cycle-file :truncate))
(fd-write out (~a "#lang zuo\n"
                  "(require \"cycle.zuo\")\n"))
(fd-close out)

(check (run-zuo `(require ,(if (relative-path? cycle-file)
			       (build-path (hash-ref (runtime-env) 'dir) cycle-file)
			       cycle-file))
                (lambda (status out err)
                  (and (not (= status 0))
                       (equal? out "")
		       (contains? err "cycle in module loading")))))

