racket/pkgs/racket-test/tests/xml/srcloc.rkt
Matthew Flatt 2d4f3e2ac9 remove the "racket-pkgs" directory layer
The layer is now redundant, since everything left in "pkgs" is in the
"racket-pkgs" category.
2014-12-08 05:22:59 -07:00

17 lines
372 B
Racket

#lang racket
(require xml
tests/eli-tester)
(define p (open-input-string "abcdef"))
(port-count-lines! p)
(for ([x (in-range 0 6)]) (read-char p))
(define-values (line col pos) (port-next-location p))
(define exn
(with-handlers ((exn:fail? values))
(read-xml/element p)))
(test
pos => 7
(srcloc-position (first ((exn:srclocs-accessor exn) exn))) => 7)