18 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Factor
		
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Factor
		
	
	
! Copyright (C) 2009 Daniel Ehrenberg
 | 
						|
! See http://factorcode.org/license.txt for BSD license.
 | 
						|
USING: io.encodings.shift-jis tools.test io.encodings.string arrays strings ;
 | 
						|
IN: io.encodings.shift-jis.tests
 | 
						|
 | 
						|
[ { CHAR: replacement-character } ] [ { 141 } shift-jis decode >array ] unit-test
 | 
						|
[ "" ] [ "" shift-jis decode >string ] unit-test
 | 
						|
[ "" ] [ "" shift-jis encode >string ] unit-test
 | 
						|
[ { CHAR: replacement-character } shift-jis encode ] must-fail
 | 
						|
[ "ab¥ィ" ] [ { CHAR: a CHAR: b 0x5C 0xA8 } shift-jis decode ] unit-test
 | 
						|
[ { CHAR: a CHAR: b 0x5C 0xA8 } ] [ "ab¥ィ" shift-jis encode >array ] unit-test
 | 
						|
[ "ab\\ィ" ] [ { CHAR: a CHAR: b 0x5C 0xA8 } windows-31j decode ] unit-test
 | 
						|
[ { CHAR: a CHAR: b 0x5C 0xA8 } ] [ "ab\\ィ" windows-31j encode >array ] unit-test
 | 
						|
[ "\u000081\u0000c8" ] [ CHAR: logical-and 1string windows-31j encode >string ] unit-test
 | 
						|
[ "\u000081\u0000c8" ] [ CHAR: logical-and 1string shift-jis encode >string ] unit-test
 | 
						|
[ { CHAR: logical-and } ] [ "\u000081\u0000c8" windows-31j decode >array ] unit-test
 | 
						|
[ { CHAR: logical-and } ] [ "\u000081\u0000c8" shift-jis decode >array ] unit-test
 |