diff options
author | Vincent Ambo <mail@tazj.in> | 2021-12-15T21·51+0300 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-12-15T22·09+0000 |
commit | db742c2035f9cfcf496b4a9b1640d1cf623a2c0f (patch) | |
tree | a9bcaf6632d910ae68185319cc5bcd408667a8d9 /third_party/lisp/s-xml/test/test-xml.lisp | |
parent | 75ca24c60a57ab894da4d404755b8b4094284ad8 (diff) |
chore(3p/lisp): use nixpkgs sources for s-xml r/3258
this one was a little more difficult because it needs a patch, there's something wonky with the definition order fwiw, the upstream cvs repository ... server errors. Change-Id: I2d99359edec36b578389f1be1fcf077743c29c4e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4342 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'third_party/lisp/s-xml/test/test-xml.lisp')
-rw-r--r-- | third_party/lisp/s-xml/test/test-xml.lisp | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/third_party/lisp/s-xml/test/test-xml.lisp b/third_party/lisp/s-xml/test/test-xml.lisp deleted file mode 100644 index daef58ea4639..000000000000 --- a/third_party/lisp/s-xml/test/test-xml.lisp +++ /dev/null @@ -1,86 +0,0 @@ -;;;; -*- mode: lisp -*- -;;;; -;;;; $Id: test-xml.lisp,v 1.3 2005/11/06 12:44:48 scaekenberghe Exp $ -;;;; -;;;; Unit and functional tests for xml.lisp -;;;; -;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. -;;;; -;;;; You are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser General Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. - -(in-package :s-xml) - -(assert - (whitespace-char-p (character " "))) - -(assert - (whitespace-char-p (character " "))) - -(assert - (whitespace-char-p (code-char 10))) - -(assert - (whitespace-char-p (code-char 13))) - -(assert - (not (whitespace-char-p #\A))) - -(assert - (char= (with-input-from-string (stream " ABC") - (skip-whitespace stream)) - #\A)) - -(assert - (char= (with-input-from-string (stream "ABC") - (skip-whitespace stream)) - #\A)) - -(assert - (string-equal (with-output-to-string (stream) (print-string-xml "<foo>" stream)) - "<foo>")) - -(assert - (string-equal (with-output-to-string (stream) (print-string-xml "' '" stream)) - "' '")) - -(assert - (let ((string (map 'string #'identity '(#\return #\tab #\newline)))) - (string-equal (with-output-to-string (stream) (print-string-xml string stream)) - string))) - -(defun simple-echo-xml (in out) - (start-parse-xml - in - (make-instance 'xml-parser-state - :new-element-hook #'(lambda (name attributes seed) - (declare (ignore seed)) - (format out "<~a~:{ ~a='~a'~}>" - name - (mapcar #'(lambda (p) (list (car p) (cdr p))) - (reverse attributes)))) - :finish-element-hook #'(lambda (name attributes parent-seed seed) - (declare (ignore attributes parent-seed seed)) - (format out "</~a>" name)) - :text-hook #'(lambda (string seed) - (declare (ignore seed)) - (princ string out))))) - -(defun simple-echo-xml-string (string) - (with-input-from-string (in string) - (with-output-to-string (out) - (simple-echo-xml in out)))) - -(dolist (*ignore-namespaces* '(nil t)) - (assert - (let ((xml "<FOO ATT1='1' ATT2='2'><B>Text</B><EMPTY></EMPTY>More text!<SUB><SUB></SUB></SUB></FOO>")) - (equal (simple-echo-xml-string xml) - xml)))) - -(assert - (let ((xml "<p> </p>")) - (equal (simple-echo-xml-string xml) - xml))) - -;;;; eof \ No newline at end of file |