Annotation inappropriate for ExpectedPlaceholderMapping
This commit is contained in:
parent
a7147fa123
commit
6f4e06f6b9
|
@ -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)))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
@<EmacsMode "-*- preserves -*-">
|
||||
@<ExpectedPlaceholderMapping {
|
||||
<TestCases
|
||||
<ExpectedPlaceholderMapping {
|
||||
0: discard
|
||||
1: capture
|
||||
2: observe
|
||||
|
@ -263,3 +264,4 @@
|
|||
]>
|
||||
|
||||
}
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue