<commit_before>#lang scheme/base
(provide (all-defined-out))

(require scheme/require-syntax
         scheme/match
         scheme/gui/dynamic
	 typed-scheme/utils/utils
         (for-syntax scheme/base)
         (types comparison utils) 
         racunit racunit/text-ui)

(provide private typecheck (rename-out [infer r:infer]) utils env rep types)

(define (mk-suite ts)
  (match (map (lambda (f) (f)) ts)
	 [(list t) t]
	 [ts (make-test-suite "Combined Test Suite" ts)]))

(define (run . ts)
  (run-tests (mk-suite ts)))

(define (test/gui suite) 
  (((dynamic-require 'racunit/private/gui/gui 'make-gui-runner))
   suite))

(define (run/gui . ts)
  (test/gui (mk-suite ts)))


(define-syntax (define-go stx)
  (syntax-case stx ()
    [(_ args ...)
     (with-syntax 
      ([go (datum->syntax stx 'go)]
       [go/gui (datum->syntax stx 'go/gui)]
       [(tmps ...) (generate-temporaries #'(args ...))])
      #'(define-values (go go/gui)
	  (let ([tmps args] ...)
	    (values (lambda () (run tmps ...))
		    (lambda () (run/gui tmps ...))))))]))

;; FIXME - do something more intelligent
(define (tc-result-equal/test? a b)
  (equal? a b))

(define-syntax (check-type-equal? stx)
  (syntax-case stx ()
    [(_ nm a b)
     (syntax/loc stx (test-check nm type-equal? a b))]))
(define-syntax (check-tc-result-equal? stx)
  (syntax-case stx ()
    [(_ nm a b)
     (syntax/loc stx (test-check nm tc-result-equal/test? a b))]))
<commit_msg>use racunit better to get expected/actual info<commit_after>#lang scheme/base
(provide (all-defined-out))

(require scheme/require-syntax
         scheme/match
         scheme/gui/dynamic
	 typed-scheme/utils/utils
         (for-syntax scheme/base)
         (types comparison utils) 
         racunit racunit/text-ui)

(provide private typecheck (rename-out [infer r:infer]) utils env rep types)

(define (mk-suite ts)
  (match (map (lambda (f) (f)) ts)
	 [(list t) t]
	 [ts (make-test-suite "Combined Test Suite" ts)]))

(define (run . ts)
  (run-tests (mk-suite ts)))

(define (test/gui suite) 
  (((dynamic-require 'racunit/private/gui/gui 'make-gui-runner))
   suite))

(define (run/gui . ts)
  (test/gui (mk-suite ts)))


(define-syntax (define-go stx)
  (syntax-case stx ()
    [(_ args ...)
     (with-syntax 
      ([go (datum->syntax stx 'go)]
       [go/gui (datum->syntax stx 'go/gui)]
       [(tmps ...) (generate-temporaries #'(args ...))])
      #'(define-values (go go/gui)
	  (let ([tmps args] ...)
	    (values (lambda () (run tmps ...))
		    (lambda () (run/gui tmps ...))))))]))

;; FIXME - do something more intelligent
(define (tc-result-equal/test? a b)
  (equal? a b))

(define-syntax (check-type-equal? stx)
  (syntax-case stx ()
    [(_ nm a b)
     (syntax/loc stx (test-check nm type-equal? a b))]))
(define-binary-check (check-tc-result-equal?* tc-result-equal/test? a b))
(define-syntax (check-tc-result-equal? stx)
  (syntax-case stx ()
    [(_ nm a b)
     (syntax/loc stx (test-case nm (check-tc-result-equal?* a b)))]))

{'fraction_non_alphanumeric': 0.18445630420280187, 'fraction_numerical': 0.0, 'mean_word_length': 2.7628607277289836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5624015', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1082, 'n_words': 283}