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

View File

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