19 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Factor
		
	
	
		
		
			
		
	
	
			19 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Factor
		
	
	
| 
								 | 
							
								USING: kernel tools.test base64 strings ;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								[ "abcdefghijklmnopqrstuvwxyz" ] [ "abcdefghijklmnopqrstuvwxyz" >base64 base64> >string
							 | 
						||
| 
								 | 
							
								] unit-test
							 | 
						||
| 
								 | 
							
								[ "" ] [ "" >base64 base64> >string ] unit-test
							 | 
						||
| 
								 | 
							
								[ "a" ] [ "a" >base64 base64> >string ] unit-test
							 | 
						||
| 
								 | 
							
								[ "ab" ] [ "ab" >base64 base64> >string ] unit-test
							 | 
						||
| 
								 | 
							
								[ "abc" ] [ "abc" >base64 base64> >string ] unit-test
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								! From http://en.wikipedia.org/wiki/Base64
							 | 
						||
| 
								 | 
							
								[ "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=" ]
							 | 
						||
| 
								 | 
							
								[
							 | 
						||
| 
								 | 
							
								    "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."
							 | 
						||
| 
								 | 
							
								    >base64 >string
							 | 
						||
| 
								 | 
							
								] unit-test
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								\ >base64 must-infer
							 | 
						||
| 
								 | 
							
								\ base64> must-infer
							 |