graphviz: simpler preview-smoke-test.

locals-and-roots
John Benediktsson 2016-03-19 13:03:37 -07:00
parent 50759f4bc6
commit 0b5ee9dce8
2 changed files with 4 additions and 7 deletions

View File

@ -55,10 +55,7 @@ SYMBOLS: supported-layouts supported-formats ;
] with-temp-directory ;
: preview-smoke-test ( graph -- pass? )
f "pass?" [
[ exists? "pass?" set ] with-preview
"pass?" get
] with-variable ;
[ exists? ] with-preview ;
: K_n ( n -- graph )
<graph>

View File

@ -115,16 +115,16 @@ PRIVATE>
[ unsupported-preview-format ]
} case ;
:: with-preview ( graph quot: ( path -- ) -- )
:: with-preview ( graph quot -- )
[
"preview" ".dot" [| code-file |
"preview" preview-extension [| image-file |
graph code-file ?encoding write-dot
code-file image-file try-preview-command
image-file quot call( path -- )
image-file quot call
] cleanup-unique-file
] cleanup-unique-file
] with-temp-directory ;
] with-temp-directory ; inline
PRIVATE>