Annotation inappropriate for ExpectedPlaceholderMapping

This commit is contained in:
Tony Garnock-Jones 2019-08-23 09:58:30 +01:00
parent a7147fa123
commit 6f4e06f6b9
2 changed files with 273 additions and 273 deletions

View File

@ -992,19 +992,17 @@
(define-runtime-path tests-path "../../../tests") (define-runtime-path tests-path "../../../tests")
(let* ((path (build-path tests-path "samples.txt")) (let* ((path (build-path tests-path "samples.txt"))
(tests (call-with-input-file path (testfile (call-with-input-file path
(lambda (p) (lambda (p)
(port-count-lines! p) (port-count-lines! p)
(read-preserve-syntax p #:source path))))) (read-preserve-syntax p #:source path)))))
(local-require racket/pretty) (match-define (peel-annotations
(define placeholder->value-map `#s(TestCases
(or (for/or [(a* (annotated-annotations tests))] ,(strip-annotations
(match (strip-annotations a*) `#s(ExpectedPlaceholderMapping ,placeholder->value-map))
[`#s(ExpectedPlaceholderMapping ,p->v) p->v] ,tests))
[_ #f])) testfile)
(hash))) (define value->placeholder-map (for/hash [((k v) (in-hash placeholder->value-map))]
(define value->placeholder-map
(for/hash [((k v) (in-hash placeholder->value-map))]
(values v k))) (values v k)))
(parameterize (parameterize
((current-value->placeholder (lambda (v) (hash-ref value->placeholder-map v #f))) ((current-value->placeholder (lambda (v) (hash-ref value->placeholder-map v #f)))

View File

@ -1,5 +1,6 @@
@<EmacsMode "-*- preserves -*-"> @<EmacsMode "-*- preserves -*-">
@<ExpectedPlaceholderMapping { <TestCases
<ExpectedPlaceholderMapping {
0: discard 0: discard
1: capture 1: capture
2: observe 2: observe
@ -263,3 +264,4 @@
]> ]>
} }
>