{"size": 1715, "ext": "rktl", "max_stars_repo_path": "compatibility-test/tests/mzlib/etc.rktl", "max_stars_repo_name": "racket/compatibility", "max_stars_repo_stars_event_min_datetime": "2018-04-30T03:47:15.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-23T06:50:15.000Z", "max_issues_repo_path": "compatibility-test/tests/mzlib/etc.rktl", "max_issues_repo_name": "NoahStoryM/compatibility", "max_issues_repo_issues_event_min_datetime": "2016-10-20T01:47:49.000Z", "max_issues_repo_issues_event_max_datetime": "2020-11-27T21:10:14.000Z", "max_forks_repo_path": "compatibility-test/tests/mzlib/etc.rktl", "max_forks_repo_name": "NoahStoryM/compatibility", "max_forks_repo_forks_event_min_datetime": "2015-03-09T12:20:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-09T05:02:56.000Z"}
{"max_stars_count": 4, "max_issues_count": 6, "max_forks_count": 8, "avg_line_length": 24.5, "max_line_length": 91, "alphanum_fraction": 0.5131195335}

(load-relative "loadtest.rktl")

(Section 'etc)

(require mzlib/etc)

(let () 
  (begin-with-definitions 
   (define-syntax (goo stx) 
     (syntax-case stx () 
       [(_ foo) #'(define-syntax (foo stx) (syntax-case stx () [(_ x) #'(define x 12)]))]))
   (goo foo)
   (foo x)
   (test 12 'bwd x)))

(let-syntax ([goo (lambda (stx) #'(begin (define z 13) (test 13 'bwd z)))])
  (let-syntax ([y (lambda (stx) #'goo)])
    (let () 
      (begin-with-definitions 
       (define-syntax (goo stx) 
	 (syntax-case stx () 
	   [(_ foo) #'(define-syntax (foo stx) (syntax-case stx () [(_ x) #'(define x 12)]))]))
       (goo foo)
       (foo x)
       y
       (test 12 'bwd x)))))

(let ()
  (begin-with-definitions 
   (define-struct a (b c))
   (test 2 'bwd (a-c (make-a 1 2)))))

(let ()
  (begin-with-definitions 
   (define-struct a (b c))
   (let ()
     (define-struct (d a) (e))
     (test 3 'bwd (d-e (make-d 1 2 3))))))

(let ()
  (begin-with-definitions 
   (define-struct a (b c))
   (define-struct (d a) (e))
   (test 3 'bwd (d-e (make-d 1 2 3)))))

(syntax-test #'(begin-with-definitions
		 (define-syntax goo 10)
		 (define goo 10)
		 12))

(let ()
  (test 3 (rec f (λ (x) 3)) 3)
  (test 3 (rec f (λ (x) x)) 3)
  (test 2 (rec f (λ (x) (if (= x 3) (f 2) x))) 3)
  (test 3 (rec (f x) 3) 3)
  (test 3 (rec (f x) x) 3)
  (test 2 (rec (f x) (if (= x 3) (f 2) x)) 3)
  (test 2 (rec (f x . y) (car y)) 1 2 3)
  (test 2 'no-duplications
        (let ([x 1]) (rec ignored (begin (set! x (+ x 1)) void)) x))
  (test 'f object-name (rec (f x) x))
  (test 'f object-name (rec (f x . y) x))
  (test 'f object-name (rec  f (lambda (x) x)))
  (test (list 2) (rec (f . x) (if (= (car x) 3) (f 2) x)) 3))


(report-errs)

