From aadb1b60bb01688aa6176aa17f32f1477d971739 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Thu, 20 Jan 2011 20:53:01 -0700 Subject: [PATCH] Repenting of misunderstanding docs --- collects/tests/xml/srcloc.rkt | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/collects/tests/xml/srcloc.rkt b/collects/tests/xml/srcloc.rkt index f4682efdd6..c7403471f2 100644 --- a/collects/tests/xml/srcloc.rkt +++ b/collects/tests/xml/srcloc.rkt @@ -2,32 +2,10 @@ (require xml tests/eli-tester) -(define (ppos p) - (define-values (line col pos) (port-next-location p)) - pos) - -; open-input-string is broken -(define (the-test first? second?) - (define is (open-input-string "abcdef")) - - (test #:failure-prefix (format "~a ~a" first? second?) - (test - (when first? (port-count-lines! is)) - (ppos is) => 1 (read-char is) - (ppos is) => 2 (read-char is) - (ppos is) => 3 (read-char is) - (when second? (port-count-lines! is)) - (ppos is) => 4 (read-char is) - (ppos is) => 5 (read-char is) - (ppos is) => 6 (read-char is)))) -(test (the-test #f #f) - (the-test #t #f) - (the-test #f #t) - (the-test #t #t)) - (define p (open-input-string "abcdef")) +(port-count-lines! p) (for ([x (in-range 0 6)]) (read-char p)) -(define pos (ppos p)) +(define-values (line col pos) (port-next-location p)) (define exn (with-handlers ((exn:fail? values))