Commit 018edd1b authored by pfdietz's avatar pfdietz
Browse files

Begin adding string printing tests

parent 40f242b3
......@@ -15,4 +15,4 @@
(load "print-complex.lsp")
(load "print-characters.lsp")
(load "print-symbols.lsp")
(load "print-strings.lsp")
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Mon Apr 19 05:53:48 2004
;;;; Contains: Tests of string printing
(in-package :cl-test)
(compile-and-load "printer-aux.lsp")
(deftest print.string.1
(write-to-string "" :escape nil :readably nil))
(deftest print.string.2
(loop for c across +standard-chars+
for s1 = (string c)
for s2 = (write-to-string s1 :escape nil :readably nil)
unless (string= s1 s2)
collect (list c s1 s2))
(deftest print.string.3
(loop for i below 256
for c = (code-char i)
when c
(let* ((s1 (string c))
(s2 (write-to-string s1 :escape nil :readably nil)))
(unless (string= s1 s2)
(list (list c s1 s2)))))
(deftest print.string.4
(loop for c across +standard-chars+
for s1 = (string c)
for s2 = (write-to-string s1 :escape t :readably nil)
unless (or (find c "\"\\") (string= (concatenate 'string "\"" s1 "\"") s2))
collect (list c s1 s2))
(deftest print.string.5
(write-to-string "\"" :escape t :readably nil)
(deftest print.string.6
(write-to-string "\\" :escape t :readably nil)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment