X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Foctets.pure.lisp;h=e78e2db29493630e035897f45f7713a9df480093;hb=4c81c652cdc32faefee1bccb84c3c9a7854e3edd;hp=d40b26095877c393b4fb8d0336531dc3ebe84fda;hpb=0fd1ec424a7e5969a76a2531e42a6b2621e63c11;p=sbcl.git diff --git a/tests/octets.pure.lisp b/tests/octets.pure.lisp index d40b260..e78e2db 100644 --- a/tests/octets.pure.lisp +++ b/tests/octets.pure.lisp @@ -260,8 +260,7 @@ (assert (equalp #(251) (string-to-octets (string (code-char 369)) :external-format :latin-2))) -#+sb-unicode -(with-test (:name (:euc-jp :decoding-errors)) +(with-test (:name (:euc-jp :decoding-errors) :skipped-on '(not :sb-unicode)) (handler-bind ((sb-int:character-decoding-error (lambda (c) (use-value #\? c)))) (assert (string= "?{?" @@ -269,23 +268,20 @@ (coerce #(182 123 253 238) '(vector (unsigned-byte 8))) :external-format :euc-jp))))) -#+sb-unicode -(with-test (:name (:utf-8 :surrogates :encoding-errors)) +(with-test (:name (:utf-8 :surrogates :encoding-errors) :skipped-on '(not :sb-unicode)) (handler-bind ((sb-int:character-encoding-error (lambda (c) (use-value #\? c)))) (assert (equalp (string-to-octets (string (code-char #xd800)) :external-format :utf-8) (vector (char-code #\?)))))) -#+sb-unicode -(with-test (:name (:utf-8 :surrogates :decoding-errors)) +(with-test (:name (:utf-8 :surrogates :decoding-errors) :skipped-on '(not :sb-unicode)) (handler-bind ((sb-int:character-decoding-error (lambda (c) (use-value #\? c)))) (assert (find #\? (octets-to-string (coerce #(237 160 128) '(vector (unsigned-byte 8))) :external-format :utf-8))))) -#+sb-unicode -(with-test (:name (:ucs-2 :out-of-range :encoding-errors)) +(with-test (:name (:ucs-2 :out-of-range :encoding-errors) :skipped-on '(not :sb-unicode)) (handler-bind ((sb-int:character-encoding-error (lambda (c) (use-value "???" c)))) (assert (equalp (string-to-octets (string (code-char #x10001)) @@ -297,8 +293,7 @@ :external-format :ucs-2be) #(0 63 0 63 0 63))))) -#+sb-unicode -(with-test (:name (:ucs-4 :out-of-range :decoding-errors)) +(with-test (:name (:ucs-4 :out-of-range :decoding-errors) :skipped-on '(not :sb-unicode)) (handler-bind ((sb-int:character-decoding-error (lambda (c) (use-value "???" c)))) (assert (equalp (octets-to-string (coerce '(1 2 3 4) '(vector (unsigned-byte 8))) @@ -316,8 +311,7 @@ :external-format :ucs-4be) (string (code-char #x10ffff)))))) -#+sb-unicode -(with-test (:name (:utf-16le :ensure-roundtrip)) +(with-test (:name (:utf-16le :ensure-roundtrip) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format :utf-16le)) (dec (x) @@ -328,8 +322,8 @@ (octets #(#x20 0 0 #x2 0 #x20 0 #xd8 0 #xdc 1 #xd8 1 #xdc #xff #xdb #xfd #xdf))) (assert (equalp (enc string) octets)) (assert (equalp (dec octets) string))))) -#+sb-unicode -(with-test (:name (:utf-16le :encoding-error)) + +(with-test (:name (:utf-16le :encoding-error) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format '(:utf-16le :replacement #\?))) (dec (x) @@ -338,8 +332,7 @@ (let ((string (map 'string 'code-char '(#xd800 #xdc00 #xfffe #x10ffff)))) (assert (equalp (enc string) #(63 0 63 0 63 0 63 0)))))) -#+sb-unicode -(with-test (:name (:utf-16be :ensure-roundtrip)) +(with-test (:name (:utf-16be :ensure-roundtrip) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format :utf-16be)) (dec (x) @@ -350,8 +343,8 @@ (octets #(0 #x20 #x2 0 #x20 0 #xd8 0 #xdc 0 #xd8 1 #xdc 1 #xdb #xff #xdf #xfd))) (assert (equalp (enc string) octets)) (assert (equalp (dec octets) string))))) -#+sb-unicode -(with-test (:name (:utf-16be :encoding-error)) + +(with-test (:name (:utf-16be :encoding-error) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format '(:utf-16be :replacement #\?))) (dec (x) @@ -360,8 +353,8 @@ (let ((string (map 'string 'code-char '(#xd800 #xdc00 #xfffe #x10ffff)))) (assert (equalp (enc string) #(0 63 0 63 0 63 0 63)))))) -#+sb-unicode -(with-test (:name (:utf-32le :ensure-roundtrip)) + +(with-test (:name (:utf-32le :ensure-roundtrip) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format :utf-32le)) (dec (x) @@ -372,8 +365,8 @@ (octets #(#x20 0 0 0 0 #x2 0 0 0 #x20 0 0 0 0 1 0 1 4 1 0 #xfd #xff #x10 0))) (assert (equalp (enc string) octets)) (assert (equalp (dec octets) string))))) -#+sb-unicode -(with-test (:name (:utf-32le :encoding-error)) + +(with-test (:name (:utf-32le :encoding-error) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format '(:utf-32le :replacement #\?))) (dec (x) @@ -382,8 +375,8 @@ (let ((string (map 'string 'code-char '(#xd800 #xdc00 #xfffe #x10ffff)))) (assert (equalp (enc string) #(63 0 0 0 63 0 0 0 63 0 0 0 63 0 0 0)))))) -#+sb-unicode -(with-test (:name (:utf-32be :ensure-roundtrip)) + +(with-test (:name (:utf-32be :ensure-roundtrip) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format :utf-32be)) (dec (x) @@ -394,8 +387,8 @@ (octets #(0 0 0 #x20 0 0 #x2 0 0 0 #x20 0 0 1 0 0 0 1 4 1 0 #x10 #xff #xfd))) (assert (equalp (enc string) octets)) (assert (equalp (dec octets) string))))) -#+sb-unicode -(with-test (:name (:utf-32be :encoding-error)) + +(with-test (:name (:utf-32be :encoding-error) :skipped-on '(not :sb-unicode)) (flet ((enc (x) (string-to-octets x :external-format '(:utf-32be :replacement #\?))) (dec (x)