| 
									
										
										
										
											2008-06-09 06:22:21 -04:00
										 |  |  | USING: io io.files splitting grouping unicode.collation | 
					
						
							|  |  |  | sequences kernel io.encodings.utf8 math.parser math.order | 
					
						
							| 
									
										
										
										
											2009-01-08 00:54:19 -05:00
										 |  |  | tools.test assocs words ;
 | 
					
						
							| 
									
										
										
										
											2008-05-20 17:57:53 -04:00
										 |  |  | IN: unicode.collation.tests | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : parse-test ( -- strings )
 | 
					
						
							| 
									
										
										
										
											2008-07-28 23:03:13 -04:00
										 |  |  |     "resource:basis/unicode/collation/CollationTest_SHIFTED.txt" | 
					
						
							| 
									
										
										
										
											2008-05-20 17:57:53 -04:00
										 |  |  |     utf8 file-lines 5 tail
 | 
					
						
							|  |  |  |     [ ";" split1 drop " " split [ hex> ] "" map-as ] map ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : test-two ( str1 str2 -- )
 | 
					
						
							| 
									
										
										
										
											2008-05-24 13:17:08 -04:00
										 |  |  |     [ +lt+ ] -rot [ string<=> ] 2curry unit-test ;
 | 
					
						
							| 
									
										
										
										
											2008-05-20 17:57:53 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-05 19:26:24 -04:00
										 |  |  | : test-equality ( str1 str2 -- )
 | 
					
						
							| 
									
										
										
										
											2008-05-25 21:21:39 -04:00
										 |  |  |     { primary= secondary= tertiary= quaternary= } | 
					
						
							| 
									
										
										
										
											2008-06-25 05:06:18 -04:00
										 |  |  |     [ execute ] with with each ;
 | 
					
						
							| 
									
										
										
										
											2008-05-25 21:21:39 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ f f f f ] [ "hello" "hi" test-equality ] unit-test | 
					
						
							| 
									
										
										
										
											2008-05-29 03:51:16 -04:00
										 |  |  | [ t f f f ] [ "hello" "h\u0000e9llo" test-equality ] unit-test | 
					
						
							| 
									
										
										
										
											2008-05-25 21:21:39 -04:00
										 |  |  | [ t t f f ] [ "hello" "HELLO" test-equality ] unit-test | 
					
						
							|  |  |  | [ t t t f ] [ "hello" "h e l l o." test-equality ] unit-test | 
					
						
							|  |  |  | [ t t t t ] [ "hello" "\0hello\0" test-equality ] unit-test | 
					
						
							| 
									
										
										
										
											2008-06-01 14:50:12 -04:00
										 |  |  | [ { "good bye" "goodbye" "hello" "HELLO" } ] | 
					
						
							|  |  |  | [ { "HELLO" "goodbye" "good bye" "hello" } sort-strings ] | 
					
						
							|  |  |  | unit-test | 
					
						
							| 
									
										
										
										
											2008-05-25 21:21:39 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-25 16:19:47 -04:00
										 |  |  | parse-test 2 <clumps> | 
					
						
							| 
									
										
										
										
											2009-01-08 00:54:19 -05:00
										 |  |  | [ test-two ] assoc-each
 |