19 lines
691 B
Racket
19 lines
691 B
Racket
#lang racket/base
|
|
(require racket/file rackunit git)
|
|
(define tmp (make-temporary-file "racket-git-stress~a" 'directory))
|
|
(dynamic-wind
|
|
void
|
|
(lambda ()
|
|
(parameterize ([current-directory tmp])
|
|
(git 'init)
|
|
(git 'config "user.name" "Stress Test")
|
|
(git 'config "user.email" "stress@example.invalid")
|
|
(for ([i (in-range 50)])
|
|
(call-with-output-file "counter.txt" #:exists 'truncate/replace
|
|
(lambda (out) (fprintf out "~a\n" i)))
|
|
(git 'add "counter.txt")
|
|
(define oid (git 'commit (format "commit ~a" i)))
|
|
(check-equal? (string-length oid) 40))
|
|
(check-equal? (length (git 'log 100)) 50)))
|
|
(lambda () (delete-directory/files tmp)))
|