| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: compiler.tests | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | USING: compiler tools.test namespaces sequences | 
					
						
							|  |  |  | kernel.private kernel math continuations continuations.private | 
					
						
							| 
									
										
										
										
											2008-09-02 02:53:01 -04:00
										 |  |  | words splitting grouping sorting accessors ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : symbolic-stack-trace ( -- newseq )
 | 
					
						
							| 
									
										
										
										
											2008-09-02 02:53:01 -04:00
										 |  |  |     error-continuation get call>> callstack>array
 | 
					
						
							| 
									
										
										
										
											2007-09-28 00:26:58 -04:00
										 |  |  |     2 group flip first ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-08 16:32:55 -04:00
										 |  |  | : foo ( -- * ) 3 throw 7 ;
 | 
					
						
							|  |  |  | : bar ( -- * ) foo 4 ;
 | 
					
						
							|  |  |  | : baz ( -- * ) bar 5 ;
 | 
					
						
							| 
									
										
										
										
											2008-02-06 14:47:19 -05:00
										 |  |  | [ baz ] [ 3 = ] must-fail-with | 
					
						
							| 
									
										
										
										
											2007-09-28 00:26:58 -04:00
										 |  |  | [ t ] [ | 
					
						
							|  |  |  |     symbolic-stack-trace | 
					
						
							| 
									
										
										
										
											2008-04-26 00:12:44 -04:00
										 |  |  |     [ word? ] filter
 | 
					
						
							| 
									
										
										
										
											2007-09-28 00:26:58 -04:00
										 |  |  |     { baz bar foo throw } tail?
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-08 16:32:55 -04:00
										 |  |  | : bleh ( seq -- seq' ) [ 3 + ] map [ 0 > ] filter ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-08 16:32:55 -04:00
										 |  |  | : stack-trace-contains? ( word -- ? ) symbolic-stack-trace memq? ;
 | 
					
						
							| 
									
										
										
										
											2007-09-28 00:26:58 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | [ t ] [ | 
					
						
							| 
									
										
										
										
											2008-02-06 14:47:19 -05:00
										 |  |  |     [ { 1 "hi" } bleh ] ignore-errors \ + stack-trace-contains? | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  |      | 
					
						
							| 
									
										
										
										
											2007-10-14 21:13:42 -04:00
										 |  |  | [ t f ] [ | 
					
						
							| 
									
										
										
										
											2008-02-06 14:47:19 -05:00
										 |  |  |     [ { "hi" } bleh ] ignore-errors
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     \ + stack-trace-contains? | 
					
						
							|  |  |  |     \ > stack-trace-contains? | 
					
						
							|  |  |  | ] unit-test |