Skip to content

Automated Resyntax fixes #700

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drracket-test/tests/drracket/autosave-recovery-gui.rkt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#lang racket/base
(require "private/drracket-test-util.rkt"
(require framework
racket/class
racket/gui/base
framework)
"private/drracket-test-util.rkt")

(let ([raw-autosave-contents
(if (file-exists? autosave:toc-path)
Expand Down
6 changes: 3 additions & 3 deletions drracket-test/tests/drracket/hangman.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#lang racket/base
(require "private/drracket-test-util.rkt"
racket/class
racket/gui/base)
(require racket/class
racket/gui/base
"private/drracket-test-util.rkt")

(fire-up-drracket-and-run-tests
(λ ()
Expand Down
8 changes: 4 additions & 4 deletions drracket-test/tests/drracket/insert-large-letters-test.rkt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#lang racket

(require tests/drracket/private/drracket-test-util
drracket/private/local-member-names
racket/gui/base
(require drracket/private/local-member-names
framework
racket/gui/base
rackunit
string-constants)
string-constants
tests/drracket/private/drracket-test-util)

(fire-up-drracket-and-run-tests
(λ ()
Expand Down
94 changes: 42 additions & 52 deletions drracket-test/tests/drracket/memory-log.rkt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#lang racket/base
(require "private/drracket-test-util.rkt"
racket/gui/base
racket/class
framework/test
(require drracket/private/syncheck/local-member-names
framework/preferences
drracket/private/syncheck/local-member-names) ;; for the syncheck:arrows-visible? method
framework/test
racket/class
racket/gui/base
"private/drracket-test-util.rkt") ;; for the syncheck:arrows-visible? method

(printf "The printouts below are designed to trick drdr into graphing them;\n")
(printf "they aren't times, but memory usage. The first is starting up DrRacket,\n")
Expand All @@ -18,57 +18,47 @@
(let loop ([cmu (current-memory-use)]
[n 20])
(collect-garbage)
(let ([new-cmu (current-memory-use)])
(cond
[(or (< n 0)
(< (abs (- cmu new-cmu))
(* 0.01 cmu)))
new-cmu]
[else
(loop new-cmu (- n 1))]))))
(define new-cmu (current-memory-use))
(cond
[(or (< n 0) (< (abs (- cmu new-cmu)) (* 0.01 cmu))) new-cmu]
[else (loop new-cmu (- n 1))])))

(void (putenv "PLTDRPLACEPRINT" "yes"))

(define (wait-and-print)
(let ([s (make-semaphore 0)])
;; let two rounds of pending events be handled.
(queue-callback (λ () (queue-callback (λ () (semaphore-post s)) #f)) #f)
(yield s)

;; print out memory use in a fake form to be tracked by drdr
(let ([n (mem-cnt)])
(printf "cpu time: ~a real time: ~a gc time: ~a\n"
n n n))))
(define s (make-semaphore 0))
;; let two rounds of pending events be handled.
(queue-callback (λ () (queue-callback (λ () (semaphore-post s)) #f)) #f)
(yield s)

;; print out memory use in a fake form to be tracked by drdr
(define n (mem-cnt))
(printf "cpu time: ~a real time: ~a gc time: ~a\n" n n n))

(fire-up-drracket-and-run-tests
(λ ()
(let ([drs-frame (wait-for-drracket-frame)])

;; initial startup memory use
(wait-and-print)

;; figure out the memory use after running check syntax once (and so the docs
;; have been loaded)
(queue-callback
(λ () (send (send drs-frame get-definitions-text) insert "#lang racket/base\n+")))
(set-module-language!)
(test:run-one (lambda () (send (send drs-frame syncheck:get-button) command)))
(wait-for-computation drs-frame)
(wait-and-print)

;; figure out the memory use after letting online check syntax run once
;; (so a place has been created and the docs loaded again (in the other place
;; this time))

; clear out the check synax results from before
(queue-callback/res (λ () (send (send drs-frame get-definitions-text) insert "\n")))
(poll-until
(λ ()
(not (send (send drs-frame get-definitions-text) syncheck:arrows-visible?))))

; enable online check syntax and wait for the results to appear
(queue-callback/res (λ () (preferences:set 'drracket:online-compilation-default-on #t)))
(poll-until
(λ ()
(send (send drs-frame get-definitions-text) syncheck:arrows-visible?)))
(wait-and-print))))
(define drs-frame (wait-for-drracket-frame))

;; initial startup memory use
(wait-and-print)

;; figure out the memory use after running check syntax once (and so the docs
;; have been loaded)
(queue-callback (λ () (send (send drs-frame get-definitions-text) insert "#lang racket/base\n+")))
(set-module-language!)
(test:run-one (lambda () (send (send drs-frame syncheck:get-button) command)))
(wait-for-computation drs-frame)
(wait-and-print)

;; figure out the memory use after letting online check syntax run once
;; (so a place has been created and the docs loaded again (in the other place
;; this time))

; clear out the check synax results from before
(queue-callback/res (λ () (send (send drs-frame get-definitions-text) insert "\n")))
(poll-until (λ () (not (send (send drs-frame get-definitions-text) syncheck:arrows-visible?))))

; enable online check syntax and wait for the results to appear
(queue-callback/res (λ () (preferences:set 'drracket:online-compilation-default-on #t)))
(poll-until (λ () (send (send drs-frame get-definitions-text) syncheck:arrows-visible?)))
(wait-and-print)))
3 changes: 2 additions & 1 deletion drracket-test/tests/drracket/repl-test-debug.rkt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#lang racket/base
(require "private/repl-test.rkt" "private/drracket-test-util.rkt")
(require "private/drracket-test-util.rkt"
"private/repl-test.rkt")
(fire-up-drracket-and-run-tests (λ () (run-test '(debug))))

(module+ test
Expand Down
37 changes: 21 additions & 16 deletions drracket-test/tests/drracket/syncheck-test.rkt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#lang racket/base

(require "private/drracket-test-util.rkt"
(require (for-syntax racket/base)
drracket/private/syncheck/local-member-names
drracket/syncheck-drracket-button
string-constants/string-constant
"private/gui.rkt"
racket/path
framework
mrlib/text-string-style-desc
racket/class
racket/list
racket/file
racket/set
racket/gui/base
racket/list
racket/path
racket/port
racket/pretty
racket/gui/base
framework
mrlib/text-string-style-desc
(for-syntax racket/base))
racket/set
string-constants/string-constant
"private/drracket-test-util.rkt"
"private/gui.rkt")

(provide main)

Expand All @@ -37,11 +37,16 @@
(define-struct prefix-test (line input pos prefix output) #:transparent)
(define-struct err-test (line input expected locations) #:transparent)

(define build-test/proc
(λ (line input expected [arrow-table '()] #:tooltips [tooltips #f]
#:setup [setup void] #:teardown [teardown void] #:extra-files [extra-files (hash)]
#:extra-info? [extra-info? #f])
(make-test line input expected arrow-table tooltips setup teardown extra-files extra-info?)))
(define (build-test/proc line
input
expected
[arrow-table '()]
#:tooltips [tooltips #f]
#:setup [setup void]
#:teardown [teardown void]
#:extra-files [extra-files (hash)]
#:extra-info? [extra-info? #f])
(make-test line input expected arrow-table tooltips setup teardown extra-files extra-info?))

(define-syntax (build-test stx)
(syntax-case stx ()
Expand Down Expand Up @@ -1754,7 +1759,7 @@


(define (main)
(define temp-dir (normalize-path (make-temporary-file "syncheck-test~a" 'directory)))
(define temp-dir (normalize-path (make-temporary-directory "syncheck-test~a")))
(dynamic-wind
void
(λ ()
Expand Down
21 changes: 9 additions & 12 deletions drracket-test/tests/drracket/teaching-lang-sharing-modules.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,19 @@ Of course, other (similar) things can go wrong, too.
(for ([exp (in-list things-to-try)])
(insert-in-definitions drs-frame (format "~s\n" exp)))
(do-execute drs-frame)
(let ([output (fetch-output drs-frame)])
(cond
[(equal? output first-line-output)
(try-interaction-test drs-frame)]
[else
(eprintf "teaching-lang-sharing-modules.rkt: got bad output from execute: ~s"
output)])))
(define output (fetch-output drs-frame))
(cond
[(equal? output first-line-output) (try-interaction-test drs-frame)]
[else (eprintf "teaching-lang-sharing-modules.rkt: got bad output from execute: ~s" output)]))
#:prefs '([plt:framework-pref:framework:autosaving-on? #f])))

(define (try-interaction-test drs-frame)
(type-in-interactions drs-frame "1\n")
(wait-for-computation drs-frame)
(let ([interactions-output (fetch-output drs-frame)])
(unless (equal? interactions-output (format "~a\n> 1\n1" first-line-output))
(error 'teaching-language-sharing-modules.rkt
"got bad output from interaction: ~s\n"
interactions-output))))
(define interactions-output (fetch-output drs-frame))
(unless (equal? interactions-output (format "~a\n> 1\n1" first-line-output))
(error 'teaching-language-sharing-modules.rkt
"got bad output from interaction: ~s\n"
interactions-output)))

(go)
Loading
Loading