diff --git a/collects/meta/props b/collects/meta/props index 1087c5d13e..3ddcbfcc8b 100644 --- a/collects/meta/props +++ b/collects/meta/props @@ -1798,6 +1798,7 @@ path/s is either such a string or a list of them. "collects/tests/scribble" responsible (eli mflatt) "collects/tests/srfi" responsible (noel chongkai jay) "collects/tests/srpersist" responsible (unknown) +"collects/tests/slatex" responsible (jay sstrickl) "collects/tests/syntax-color" responsible (sowens mflatt) "collects/tests/test-engine" responsible (kathyg) "collects/tests/unstable/generics.ss" responsible (jay) diff --git a/collects/slatex/internal-doc.txt b/collects/slatex/README similarity index 100% rename from collects/slatex/internal-doc.txt rename to collects/slatex/README diff --git a/collects/slatex/slatex-wrapper.ss b/collects/slatex/slatex-wrapper.ss index 4cd37d50f9..83fa80acd2 100644 --- a/collects/slatex/slatex-wrapper.ss +++ b/collects/slatex/slatex-wrapper.ss @@ -1,12 +1,18 @@ (module slatex-wrapper scheme/base (require mzlib/file + scheme/contract mzlib/process mzlib/sendevent "slatex.ss") - (provide slatex latex pdf-slatex pdf-latex slatex/no-latex - filename->latex-filename) + (provide/contract + [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) (path->string diff --git a/collects/tests/slatex/test.rkt b/collects/tests/slatex/test.rkt new file mode 100644 index 0000000000..c24d2c2e06 --- /dev/null +++ b/collects/tests/slatex/test.rkt @@ -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 #<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)) + \ No newline at end of file