(unless (>= (version) 15.2) (error 'load 'erricf 'teststrgio)) (unless (featurep 'testcomm) (libload testcomm)) (setq biglist (makelist 150 1)) (setq bigstring (makestring 301 #\sp)) (for (i 1 2 300) (sset bigstring i #/1)) (sset bigstring 0 #/() (sset bigstring 300 #/)) (de foo (s) (read-from-string (print-to-string s))) (de rfs (s) (read-from-string s)) (de pts (e) (print-to-string e)) (testfn ()) (test-serie "Test de read-from-string" ()) (rfs "()") () (rfs "12") 12 (rfs "1.23") 1.23 (rfs "coucou") coucou (rfs "(1 2 3)") (1 2 3) (rfs """hello?""") "hello?" (test-serie "Test de print-to-string" ()) (pts ()) "()" (pts 12) "12" (pts 1.23) "1.23" (pts 'coucou) "coucou" (pts '(1 2 3)) "(1 2 3)" (pts "hello?") "hello?" (pts biglist) ("EOS durant un PRINT" print-to-string ()) (with-output-to-string (setq result (makestring 301 #\sp)) 0 (prin biglist)) 301 result #.bigstring (test-serie "Fin du test" ()) () ()