{"size": 837, "ext": "rktl", "max_stars_repo_path": "compatibility-test/tests/mzlib/awk.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/awk.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/awk.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": 21.4615384615, "max_line_length": 51, "alphanum_fraction": 0.486260454}

(load-relative "loadtest.rktl")

(Section 'awk)

(require mzlib/awk)

(define-syntax (test-awk stx)
  (syntax-case stx ()
    [(_ val body ...) 
     (with-syntax ([next (datum->syntax stx 'next)]
		   [result (datum->syntax stx 'result)])
       (syntax
	(let* ([p (open-input-string "Hello world.")]
	       [next (lambda () (let ([o (read p)])
				  (if (eof-object? o)
				      o
				      (symbol->string o))))]
	       [r null]
	       [result (lambda (v)
			 (set! r (append r (list v))))])
	  body ...
	  (test val 'awk r))))]))
			
		

(test-awk '(hi there)
	  (awk (next) (str) ()
	       ["ell" (result 'hi)]
	       ["x" (result 'yikes)]
	       ["orl" (result 'there)]))

(test-awk '("l" done)
	  (awk (next) (str) ()
	       [/ "el(l)" / (#f a) (result a)]
	       [(equal? str "world.") (result 'done)]))

(report-errs)
