   []
   (re-pattern (str (comment) "%require +")))
 
-(defn testcode
-  "A regular expression matching the beginning of a test comment."
+(defn test-begin
+  "A regular expression matching a test-begin line."
   []
-  (re-pattern (str (comment) "\\? ")))
+  (re-pattern (str (comment) "<\\?")))
+
+(defn test-end
+  "A regular expression matching a test-end line."
+  []
+  (re-pattern (str (comment) "\\?>")))
 
 
 ; ## Parsing

                 ["-t" "--theme" "SyntaxHighlighter theme file"]
                 ["-l" "--language" "SyntaxHighlighter language"]
                 ["-s" "--stylesheet" "A stylesheet file to include"]
                 ["-t" "--testtree" "Test tree directory (no documentation)."]
                 ["-v" "--verbose" "Turn on verbose output"
                  :default false :flag true]
                 ["-h" "--help" "Show this help" :default false :flag true])]


; ## Testing

(defn write-production-file
  ""
  [in-file outdir]
  (let [out-file (io/file outdir in-file)
        in-test? (atom false)]
    (.. out-file (getParentFile) (mkdirs))
    (map-lines
      in-file out-file
