slatex test, slatex contracts and props
This commit is contained in:
parent
e258476748
commit
5b779d22ac
|
@ -1798,6 +1798,7 @@ path/s is either such a string or a list of them.
|
||||||
"collects/tests/scribble" responsible (eli mflatt)
|
"collects/tests/scribble" responsible (eli mflatt)
|
||||||
"collects/tests/srfi" responsible (noel chongkai jay)
|
"collects/tests/srfi" responsible (noel chongkai jay)
|
||||||
"collects/tests/srpersist" responsible (unknown)
|
"collects/tests/srpersist" responsible (unknown)
|
||||||
|
"collects/tests/slatex" responsible (jay sstrickl)
|
||||||
"collects/tests/syntax-color" responsible (sowens mflatt)
|
"collects/tests/syntax-color" responsible (sowens mflatt)
|
||||||
"collects/tests/test-engine" responsible (kathyg)
|
"collects/tests/test-engine" responsible (kathyg)
|
||||||
"collects/tests/unstable/generics.ss" responsible (jay)
|
"collects/tests/unstable/generics.ss" responsible (jay)
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
|
|
||||||
(module slatex-wrapper scheme/base
|
(module slatex-wrapper scheme/base
|
||||||
(require mzlib/file
|
(require mzlib/file
|
||||||
|
scheme/contract
|
||||||
mzlib/process
|
mzlib/process
|
||||||
mzlib/sendevent
|
mzlib/sendevent
|
||||||
"slatex.ss")
|
"slatex.ss")
|
||||||
|
|
||||||
(provide slatex latex pdf-slatex pdf-latex slatex/no-latex
|
(provide/contract
|
||||||
filename->latex-filename)
|
[slatex (string? . -> . boolean?)]
|
||||||
|
[pdf-slatex (string? . -> . boolean?)]
|
||||||
|
[slatex/no-latex (string? . -> . boolean?)]
|
||||||
|
[latex (string? . -> . boolean?)]
|
||||||
|
[pdf-latex (string? . -> . boolean?)]
|
||||||
|
[filename->latex-filename (string? . -> . string?)])
|
||||||
|
|
||||||
(define (add-suffix p s)
|
(define (add-suffix p s)
|
||||||
(path->string
|
(path->string
|
||||||
|
|
63
collects/tests/slatex/test.rkt
Normal file
63
collects/tests/slatex/test.rkt
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
#lang racket
|
||||||
|
(require slatex/slatex-wrapper
|
||||||
|
tests/eli-tester
|
||||||
|
scheme/runtime-path)
|
||||||
|
|
||||||
|
(define-runtime-path slatex-file-pth '(lib "slatex"))
|
||||||
|
(define slatex-pth (path-only slatex-file-pth))
|
||||||
|
|
||||||
|
(define tmp-file (build-path (current-directory) "test.tex")
|
||||||
|
#;(make-temporary-file "slatex~a.tex" #f (current-directory)))
|
||||||
|
|
||||||
|
(test
|
||||||
|
(putenv "TEXINPUTS" (format "~a:" (path->string slatex-pth)))
|
||||||
|
tmp-file
|
||||||
|
|
||||||
|
(with-output-to-file tmp-file #:exists 'truncate/replace
|
||||||
|
(lambda ()
|
||||||
|
(display #<<END
|
||||||
|
\documentclass{article}
|
||||||
|
\usepackage{slatex}
|
||||||
|
%
|
||||||
|
%That was LaTeX2e. If you use
|
||||||
|
%LaTeX2.09, or LaTeX2e in
|
||||||
|
%2.09 compatibility mode, use
|
||||||
|
%
|
||||||
|
%\documentstyle[slatex]{article}
|
||||||
|
%
|
||||||
|
%or
|
||||||
|
%
|
||||||
|
%\documentstyle{article}
|
||||||
|
%\input slatex.sty
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
In Scheme, the expression
|
||||||
|
\scheme|(set! x 42)| returns
|
||||||
|
an unspecified value, rather
|
||||||
|
than \scheme'42'. However,
|
||||||
|
one could get a \scheme{set!}
|
||||||
|
of the latter style with:
|
||||||
|
|
||||||
|
\begin{schemedisplay}
|
||||||
|
(define-syntax setq
|
||||||
|
(syntax-rules ()
|
||||||
|
[(setq x a)
|
||||||
|
(begin (set! x a)
|
||||||
|
x)]))
|
||||||
|
\end{schemedisplay}
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
END
|
||||||
|
)))
|
||||||
|
|
||||||
|
(slatex (path->string tmp-file))
|
||||||
|
|
||||||
|
(with-handlers ([exn:fail:filesystem? void])
|
||||||
|
(delete-file (path-replace-suffix tmp-file #".aux")))
|
||||||
|
(with-handlers ([exn:fail:filesystem? void])
|
||||||
|
(delete-file (path-replace-suffix tmp-file #".log")))
|
||||||
|
(with-handlers ([exn:fail:filesystem? void])
|
||||||
|
(delete-file (path-replace-suffix tmp-file #".dvi")))
|
||||||
|
|
||||||
|
(delete-file tmp-file))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user