Skip to content

Commit

Permalink
test cases for arrows from define-local-member-name
Browse files Browse the repository at this point in the history
  • Loading branch information
rfindler committed May 19, 2023
1 parent cda4737 commit 75d4299
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions drracket-tool-test/tests/check-syntax/syncheck-direct.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,43 @@
'((66 77) (92 95)) ;; sketchy; should we eliminate?
'((85 88) (92 95))))

(check-equal?
(for/set ([e (in-set
(get-binding-arrows
(string-append
"(module m racket\n"
" (define-local-member-name the-method-name)\n"
" (class object% (define/public (the-method-name x) 0))\n"
" (send #f the-method-name))\n")))]
;; filter out arrows that don't start on `the-method-name`
#:when (equal? '(45 60) (car e)))
e)
(set
'((45 60) (129 144))
'((45 60) (95 110))))

(check-equal?
(for/set ([e (in-set
(get-binding-arrows
(string-append
"(module m racket\n"
" (define-local-member-name the-method-name)\n"
" (class object%\n"
" (define/public (the-method-name n)\n"
" (unless (zero? n)\n"
" (if (even? n)\n"
" (send this the-method-name (- n 1))\n"
" (the-method-name (- n 1)))))))\n")))]
;; filter out arrows that don't start on the
;; `the-method-name` that appears inside
;; `define-local-member-name`
#:when (equal? '(45 60) (car e)))
e)
(set
'((45 60) (99 114))
'((45 60) (187 202))
'((45 60) (225 240))))

;
;
;
Expand Down

0 comments on commit 75d4299

Please sign in to comment.