{"size": 1398, "ext": "rktl", "max_stars_repo_path": "compatibility-test/tests/mzlib/structlib.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/structlib.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/structlib.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": 34.0975609756, "max_line_length": 75, "alphanum_fraction": 0.6623748212}

(load-relative "loadtest.rktl")

(Section 'structlib)

(require mzlib/struct)

(let* ([now (seconds->date (current-seconds))]
       [v (modulo (add1 (date-second now)) 60)])
  (test #t equal? now (copy-struct date* now))
  (test #f equal? now (copy-struct date* now (date-second v)))
  (test v date-second (copy-struct date* now (date-second v)))
  (test (date-year now) date-year (copy-struct date* now (date-second v))))

(err/rt-test (copy-struct date 10))
(err/rt-test (copy-struct date 10 (date-second 0)))

(syntax-test #'copy-struct)
(syntax-test #'(copy-struct))
(syntax-test #'(copy-struct date))
(syntax-test #'(copy-struct date 10 foo))
(syntax-test #'(copy-struct date 10 . foo))
(syntax-test #'(copy-struct date 10 (foo)))
(syntax-test #'(copy-struct date 10 (foo . bar)))

(syntax-test #'(copy-struct x 10))
(syntax-test #'(copy-struct date 10 (date-foo 12)))
(syntax-test #'(copy-struct date 10 (date-second 12) (date-yeeer 10)))
(syntax-test #'(copy-struct date 10 (date-second 12) (date-second 10)))

(require (only-in mzscheme [date-second mz:date-second]))
(syntax-test #'(copy-struct date 10 (date-second 12) (mz:date-second 10)))

(let ([v (let ()
	   (define-struct a (b c) #:inspector (make-inspector))
	   ;; This `copy-struct' is expanded in an internal-defn context
	   (copy-struct a (make-a 1 2) (a-c 13)))])
  (test #(struct:a 1 13) struct->vector v))

(report-errs)
