| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  | USING: accessors arrays classes.intersection classes.maybe | 
					
						
							|  |  |  | classes.union compiler.units continuations definitions effects | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | eval generic generic.standard hashtables io io.streams.duplex | 
					
						
							| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  | io.streams.string kernel listener make math namespaces parser | 
					
						
							|  |  |  | prettyprint prettyprint.config prettyprint.private | 
					
						
							|  |  |  | prettyprint.sections see sequences splitting | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | strings tools.continuations tools.continuations.private | 
					
						
							|  |  |  | tools.test vectors vocabs.parser words ;
 | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: prettyprint.tests | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "4" } [ 4 unparse ] unit-test | 
					
						
							|  |  |  | { "4096" } [ 4096 unparse ] unit-test | 
					
						
							|  |  |  | { "0b1000000000000" } [ 2 number-base [ 4096 unparse ] with-variable ] unit-test | 
					
						
							|  |  |  | { "0o10000" } [ 8 number-base [ 4096 unparse ] with-variable ] unit-test | 
					
						
							|  |  |  | { "0x1000" } [ 16 number-base [ 4096 unparse ] with-variable ] unit-test | 
					
						
							|  |  |  | { "1.0" } [ 1.0 unparse ] unit-test | 
					
						
							|  |  |  | { "8.0" } [ 8.0 unparse ] unit-test | 
					
						
							|  |  |  | { "8.0" } [ 2 number-base [ 8.0 unparse ] with-variable ] unit-test | 
					
						
							|  |  |  | { "8.0" } [ 8 number-base [ 8.0 unparse ] with-variable ] unit-test | 
					
						
							|  |  |  | { "0x1.0p3" } [ 16 number-base [ 8.0 unparse ] with-variable ] unit-test | 
					
						
							|  |  |  | { "1267650600228229401496703205376" } [ 1 100 shift unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "+" } [ \ + unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "\\ +" } [ [ \ + ] first unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "{ }" } [ { } unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "{ 1 2 3 }" } [ { 1 2 3 } unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "\"hello\\\\backslash\"" } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | [ "hello\\backslash" unparse ] | 
					
						
							|  |  |  | unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-02 16:00:05 -05:00
										 |  |  | ! [ "\"\\u123456\"" ] | 
					
						
							|  |  |  | ! [ "\u123456" unparse ] | 
					
						
							|  |  |  | ! unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "\"\\e\"" } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | [ "\e" unparse ] | 
					
						
							|  |  |  | unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "\"\\x01\"" } | 
					
						
							| 
									
										
										
										
											2012-07-29 13:14:54 -04:00
										 |  |  | [ 1 1string unparse ] | 
					
						
							|  |  |  | unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "f" } [ f unparse ] unit-test | 
					
						
							|  |  |  | { "t" } [ t unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "SBUF\" hello world\"" } [ SBUF" hello world" unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "W{ \\ + }" } [ [ W{ \ + } ] first unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { } [ \ fixnum see ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { } [ \ integer see ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { } [ \ generic see ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { } [ \ duplex-stream see ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "[ \\ + ]" } [ [ \ + ] unparse ] unit-test | 
					
						
							|  |  |  | { "[ \\ [ ]" } [ [ \ [ ] unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2015-07-02 13:34:01 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2008-02-21 02:26:44 -05:00
										 |  |  |     100 \ dup <array> unparse-short | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     "{" head?
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : foo ( a -- b ) dup * ; inline
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "USING: kernel math ;\nIN: prettyprint.tests\n: foo ( a -- b ) dup * ; inline\n" } | 
					
						
							| 
									
										
										
										
											2008-02-15 23:20:31 -05:00
										 |  |  | [ [ \ foo see ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : bar ( x -- y ) 2 + ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "USING: math ;\nIN: prettyprint.tests\n: bar ( x -- y ) 2 + ;\n" } | 
					
						
							| 
									
										
										
										
											2008-02-15 23:20:31 -05:00
										 |  |  | [ [ \ bar see ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-23 01:34:02 -04:00
										 |  |  | : blah ( a a a a a a a a a a a a a a a a a a a a -- )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     drop ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "drop ;" } [ | 
					
						
							| 
									
										
										
										
											2008-02-15 23:20:31 -05:00
										 |  |  |     [ \ blah see ] with-string-writer "\n" ?tail drop 6 tail*
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  | : check-see ( expect name -- ? )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     [ | 
					
						
							|  |  |  |         [ | 
					
						
							| 
									
										
										
										
											2007-12-24 19:40:09 -05:00
										 |  |  |             [ parse-fresh drop ] with-compilation-unit | 
					
						
							|  |  |  |             [ | 
					
						
							| 
									
										
										
										
											2011-11-06 18:57:24 -05:00
										 |  |  |                 "prettyprint.tests" lookup-word see | 
					
						
							| 
									
										
										
										
											2008-05-07 02:38:34 -04:00
										 |  |  |             ] with-string-writer "\n" split but-last
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         ] keep =
 | 
					
						
							| 
									
										
										
										
											2009-05-16 01:29:21 -04:00
										 |  |  |     ] with-interactive-vocabs ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-23 01:34:02 -04:00
										 |  |  | GENERIC: method-layout ( a -- b )
 | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | M: complex method-layout | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  |     drop
 | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |     "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" | 
					
						
							|  |  |  |     ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: fixnum method-layout ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: integer method-layout ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: object method-layout ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  |         "USING: kernel math prettyprint.tests ;" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "M: complex method-layout" | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  |         "    drop" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "    \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"" | 
					
						
							|  |  |  |         "    ;" | 
					
						
							|  |  |  |         "" | 
					
						
							| 
									
										
										
										
											2008-03-03 17:44:24 -05:00
										 |  |  |         "USING: math prettyprint.tests ;" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "M: fixnum method-layout ;" | 
					
						
							|  |  |  |         "" | 
					
						
							| 
									
										
										
										
											2008-03-03 17:44:24 -05:00
										 |  |  |         "USING: math prettyprint.tests ;" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "M: integer method-layout ;" | 
					
						
							|  |  |  |         "" | 
					
						
							| 
									
										
										
										
											2008-03-03 17:44:24 -05:00
										 |  |  |         "USING: kernel prettyprint.tests ;" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "M: object method-layout ;" | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |     [ \ method-layout see-methods ] with-string-writer "\n" split | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-23 01:34:02 -04:00
										 |  |  | : soft-break-test ( -- str )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { | 
					
						
							|  |  |  |         "USING: kernel math sequences strings ;" | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2008-01-04 21:10:49 -05:00
										 |  |  |         ": soft-break-layout ( x y -- ? )" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "    over string? [" | 
					
						
							|  |  |  |         "        over hashcode over hashcode number=" | 
					
						
							|  |  |  |         "        [ sequence= ] [ 2drop f ] if" | 
					
						
							|  |  |  |         "    ] [ 2drop f ] if ;" | 
					
						
							|  |  |  |     } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     "soft-break-layout" soft-break-test check-see | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 05:06:18 -04:00
										 |  |  | DEFER: parse-error-file | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-23 01:34:02 -04:00
										 |  |  | : another-soft-break-test ( -- str )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-09-11 01:20:06 -04:00
										 |  |  |         "USING: make sequences ;" | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         ": another-soft-break-layout ( node -- quot )" | 
					
						
							|  |  |  |         "    parse-error-file" | 
					
						
							| 
									
										
										
										
											2008-03-31 21:24:48 -04:00
										 |  |  |         "    [ <reversed> \"hello world foo\" suffix ] [ ] make ;" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     "another-soft-break-layout" another-soft-break-test | 
					
						
							|  |  |  |     check-see | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-23 01:34:02 -04:00
										 |  |  | : string-layout ( -- str )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-08-30 22:55:29 -04:00
										 |  |  |         "USING: accessors debugger io kernel ;" | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2008-01-04 21:10:49 -05:00
										 |  |  |         ": string-layout-test ( error -- )" | 
					
						
							| 
									
										
										
										
											2008-08-30 22:55:29 -04:00
										 |  |  |         "    \"Expected \" write dup want>> expected>string write" | 
					
						
							|  |  |  |         "    \" but got \" write got>> expected>string print ;" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     "string-layout-test" string-layout check-see | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  | : narrow-test ( -- array )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { | 
					
						
							|  |  |  |         "USING: arrays combinators continuations kernel sequences ;" | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  |         ": narrow-layout ( obj1 obj2 -- obj3 )" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "    {" | 
					
						
							|  |  |  |         "        { [ dup continuation? ] [ append ] }" | 
					
						
							|  |  |  |         "        { [ dup not ] [ drop reverse ] }" | 
					
						
							| 
									
										
										
										
											2009-10-28 00:25:35 -04:00
										 |  |  |         "        { [ dup pair? ] [ [ remove! drop ] keep ] }" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "    } cond ;" | 
					
						
							|  |  |  |     } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     "narrow-layout" narrow-test check-see | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-17 13:46:04 -04:00
										 |  |  | : another-narrow-test ( -- array )
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2008-01-04 21:10:49 -05:00
										 |  |  |         ": another-narrow-layout ( -- obj )" | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         "    H{" | 
					
						
							|  |  |  |         "        { 1 2 }" | 
					
						
							|  |  |  |         "        { 3 4 }" | 
					
						
							|  |  |  |         "        { 5 6 }" | 
					
						
							|  |  |  |         "        { 7 8 }" | 
					
						
							|  |  |  |         "        { 9 10 }" | 
					
						
							|  |  |  |         "        { 11 12 }" | 
					
						
							|  |  |  |         "        { 13 14 }" | 
					
						
							|  |  |  |         "    } ;" | 
					
						
							|  |  |  |     } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     "another-narrow-layout" another-narrow-test check-see | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  | IN: prettyprint.tests | 
					
						
							|  |  |  | TUPLE: class-see-layout ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | IN: prettyprint.tests | 
					
						
							|  |  |  | GENERIC: class-see-layout ( x -- y )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USING: prettyprint.tests ;
 | 
					
						
							|  |  |  | M: class-see-layout class-see-layout ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-12-25 18:11:56 -05:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2008-01-04 21:10:49 -05:00
										 |  |  |         "TUPLE: class-see-layout ;" | 
					
						
							|  |  |  |         "" | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |         "IN: prettyprint.tests" | 
					
						
							| 
									
										
										
										
											2008-01-04 21:10:49 -05:00
										 |  |  |         "GENERIC: class-see-layout ( x -- y )" | 
					
						
							| 
									
										
										
										
											2007-12-25 18:11:56 -05:00
										 |  |  |         "" | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |     [ \ class-see-layout see ] with-string-writer "\n" split | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-03-03 17:44:24 -05:00
										 |  |  |         "USING: prettyprint.tests ;" | 
					
						
							| 
									
										
										
										
											2007-12-25 18:11:56 -05:00
										 |  |  |         "M: class-see-layout class-see-layout ;" | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 |  |  |     [ \ class-see-layout see-methods ] with-string-writer "\n" split | 
					
						
							| 
									
										
										
										
											2007-12-25 18:11:56 -05:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { } [ \ in>> synopsis drop ] unit-test | 
					
						
							| 
									
										
										
										
											2007-10-05 15:26:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-13 17:08:32 -05:00
										 |  |  | ! Regression | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  |     "IN: prettyprint.tests\nGENERIC: generic-decl-test ( a -- b ) flushable\n" | 
					
						
							| 
									
										
										
										
											2009-04-17 16:49:21 -04:00
										 |  |  |     dup eval( -- ) | 
					
						
							| 
									
										
										
										
											2011-11-06 18:57:24 -05:00
										 |  |  |     "generic-decl-test" "prettyprint.tests" lookup-word | 
					
						
							| 
									
										
										
										
											2008-02-15 23:20:31 -05:00
										 |  |  |     [ see ] with-string-writer =
 | 
					
						
							| 
									
										
										
										
											2008-01-13 17:08:32 -05:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { [ + ] } [ [ \ + (step-into-execute) ] (remove-breakpoints) ] unit-test | 
					
						
							| 
									
										
										
										
											2007-10-05 15:26:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { [ (step-into-execute) ] } [ [ (step-into-execute) ] (remove-breakpoints) ] unit-test | 
					
						
							| 
									
										
										
										
											2015-07-02 13:34:01 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { [ 2 2 + . ] } [ | 
					
						
							| 
									
										
										
										
											2008-02-21 03:08:08 -05:00
										 |  |  |     [ 2 2 \ + (step-into-execute) . ] (remove-breakpoints) | 
					
						
							| 
									
										
										
										
											2007-10-05 15:26:40 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { [ 2 2 + . ] } [ | 
					
						
							| 
									
										
										
										
											2008-02-21 03:08:08 -05:00
										 |  |  |     [ 2 break 2 \ + (step-into-execute) . ] (remove-breakpoints) | 
					
						
							| 
									
										
										
										
											2007-10-09 01:30:28 -04:00
										 |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-11 16:28:09 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-03-18 22:43:29 -04:00
										 |  |  | GENERIC: generic-see-test-with-f ( obj -- obj )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: f generic-see-test-with-f ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "USING: prettyprint.tests ;\nM: f generic-see-test-with-f ;\n" } [ | 
					
						
							| 
									
										
										
										
											2009-04-06 04:30:23 -04:00
										 |  |  |     [ M\ f generic-see-test-with-f see ] with-string-writer | 
					
						
							| 
									
										
										
										
											2008-03-18 22:43:29 -04:00
										 |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2008-03-26 19:23:19 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | PREDICATE: predicate-see-test < integer even? ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "USING: math ;\nIN: prettyprint.tests\nPREDICATE: predicate-see-test < integer even? ;\n" } [ | 
					
						
							| 
									
										
										
										
											2008-03-26 19:23:19 -04:00
										 |  |  |     [ \ predicate-see-test see ] with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2008-04-03 20:08:34 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-11 01:41:47 -04:00
										 |  |  | INTERSECTION: intersection-see-test sequence number ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "USING: math sequences ;\nIN: prettyprint.tests\nINTERSECTION: intersection-see-test sequence number ;\n" } [ | 
					
						
							| 
									
										
										
										
											2008-05-11 01:41:47 -04:00
										 |  |  |     [ \ intersection-see-test see ] with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { } [ \ compose see ] unit-test | 
					
						
							|  |  |  | { } [ \ curry see ] unit-test | 
					
						
							| 
									
										
										
										
											2008-05-23 18:45:00 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "POSTPONE: [" } [ \ [ unparse ] unit-test | 
					
						
							| 
									
										
										
										
											2015-07-02 13:34:01 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-17 09:47:08 -05:00
										 |  |  | TUPLE: started-out-hustlin' ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-23 01:34:02 -04:00
										 |  |  | GENERIC: ended-up-ballin' ( a -- b )
 | 
					
						
							| 
									
										
										
										
											2008-11-17 09:47:08 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | M: started-out-hustlin' ended-up-ballin' ; inline
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "USING: prettyprint.tests ;\nM: started-out-hustlin' ended-up-ballin' ; inline\n" } [ | 
					
						
							| 
									
										
										
										
											2009-04-06 04:30:23 -04:00
										 |  |  |     [ M\ started-out-hustlin' ended-up-ballin' see ] with-string-writer | 
					
						
							| 
									
										
										
										
											2008-11-17 09:47:08 -05:00
										 |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | TUPLE: tuple-with-declared-slot { x integer } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     { | 
					
						
							|  |  |  |         "USING: math ;" | 
					
						
							|  |  |  |         "IN: prettyprint.tests" | 
					
						
							|  |  |  |         "TUPLE: tuple-with-declared-slot { x integer initial: 0 } ;" | 
					
						
							|  |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     [ \ tuple-with-declared-slot see ] with-string-writer "\n" split | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TUPLE: tuple-with-read-only-slot { x read-only } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     { | 
					
						
							|  |  |  |         "IN: prettyprint.tests" | 
					
						
							|  |  |  |         "TUPLE: tuple-with-read-only-slot { x read-only } ;" | 
					
						
							|  |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     [ \ tuple-with-read-only-slot see ] with-string-writer "\n" split | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TUPLE: tuple-with-initial-slot { x initial: 123 } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     { | 
					
						
							|  |  |  |         "IN: prettyprint.tests" | 
					
						
							|  |  |  |         "TUPLE: tuple-with-initial-slot { x initial: 123 } ;" | 
					
						
							|  |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     [ \ tuple-with-initial-slot see ] with-string-writer "\n" split | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TUPLE: tuple-with-initial-declared-slot { x integer initial: 123 } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     { | 
					
						
							|  |  |  |         "USING: math ;" | 
					
						
							|  |  |  |         "IN: prettyprint.tests" | 
					
						
							|  |  |  |         "TUPLE: tuple-with-initial-declared-slot" | 
					
						
							|  |  |  |         "    { x integer initial: 123 } ;" | 
					
						
							|  |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2009-06-14 18:46:29 -04:00
										 |  |  |     [ \ tuple-with-initial-declared-slot see ] with-string-writer "\n" split | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2010-02-17 09:01:26 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | TUPLE: final-tuple ; final
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-02-17 09:01:26 -05:00
										 |  |  |     { | 
					
						
							|  |  |  |         "IN: prettyprint.tests" | 
					
						
							|  |  |  |         "TUPLE: final-tuple ; final" | 
					
						
							|  |  |  |         "" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2010-02-17 09:01:26 -05:00
										 |  |  |     [ \ final-tuple see ] with-string-writer "\n" split | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2010-06-28 12:10:16 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "H{ { 1 2 } }\n" } [ [ H{ { 1 2 } } short. ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2010-06-28 12:10:16 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "H{ { 1 ~array~ } }\n" } [ [ H{ { 1 { 2 } } } short. ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2010-06-28 12:10:16 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "{ ~array~ }\n" } [ [ { { 1 2 } } short. ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2010-06-28 12:10:16 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "H{ { 1 { 2 3 } } }\n" } [ | 
					
						
							| 
									
										
										
										
											2010-06-28 12:10:16 -04:00
										 |  |  |     f nesting-limit [ | 
					
						
							|  |  |  |         [ H{ { 1 { 2 3 } } } . ] with-string-writer | 
					
						
							|  |  |  |     ] with-variable
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "maybe{ integer }\n" } [ [  maybe{ integer } . ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-22 02:00:52 -05:00
										 |  |  | TUPLE: bob a b ;
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { "maybe{ bob }\n" } [ [ maybe{ bob } . ] with-string-writer ] unit-test | 
					
						
							|  |  |  | { "maybe{ word }\n" } [ [ maybe{ word } . ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-22 17:47:52 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | TUPLE: har a ;
 | 
					
						
							|  |  |  | GENERIC: harhar ( obj -- obj )
 | 
					
						
							| 
									
										
										
										
											2012-05-03 22:17:41 -04:00
										 |  |  | M: maybe{ har } harhar ;
 | 
					
						
							| 
									
										
										
										
											2011-11-22 17:47:52 -05:00
										 |  |  | M: integer harhar M\ integer harhar drop ;
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "USING: prettyprint.tests ;
 | 
					
						
							| 
									
										
										
										
											2012-05-03 22:17:41 -04:00
										 |  |  | M: maybe{ har } harhar ;
 | 
					
						
							| 
									
										
										
										
											2011-11-22 17:47:52 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | USING: kernel math prettyprint.tests ;
 | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | M: integer harhar M\\ integer harhar drop ;\n" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2011-11-22 17:47:52 -05:00
										 |  |  |     [ \ harhar see-methods ] with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | TUPLE: mo { a union{ float integer } } ;
 | 
					
						
							|  |  |  | TUPLE: fo { a intersection{ fixnum integer } } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "USING: math ;
 | 
					
						
							| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  | IN: prettyprint.tests | 
					
						
							| 
									
										
										
										
											2012-05-04 12:09:14 -04:00
										 |  |  | TUPLE: mo { a union{ integer float } initial: 0 } ;
 | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | " | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  |     [ \ mo see ] with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "USING: math ;
 | 
					
						
							| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  | IN: prettyprint.tests | 
					
						
							| 
									
										
										
										
											2012-05-04 12:09:14 -04:00
										 |  |  | TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ;
 | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | " | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2011-11-22 21:49:18 -05:00
										 |  |  |     [ \ fo see ] with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "union{ intersection{ string hashtable } union{ integer float } }\n" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ [ union{ union{ float integer } intersection{ string hashtable } } . ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "intersection{ | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  |     intersection{ string hashtable } | 
					
						
							| 
									
										
										
										
											2012-05-04 12:09:14 -04:00
										 |  |  |     union{ integer float } | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | " | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ [ intersection{ union{ float integer } intersection{ string hashtable } } . ] with-string-writer ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "maybe{ union{ integer float } }\n" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2012-05-03 22:17:41 -04:00
										 |  |  |     [ maybe{ union{ float integer } } . ] with-string-writer | 
					
						
							| 
									
										
										
										
											2011-11-23 04:19:09 -05:00
										 |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2011-11-23 04:43:02 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "maybe{ maybe{ integer } }\n" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ | 
					
						
							| 
									
										
										
										
											2012-05-03 22:17:41 -04:00
										 |  |  |     [ maybe{ maybe{ integer } } . ] with-string-writer | 
					
						
							| 
									
										
										
										
											2011-11-23 04:43:02 -05:00
										 |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2012-06-01 18:15:29 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | { "{ 0 1 2 3 4 }" } [ | 
					
						
							|  |  |  |     [ 5 length-limit [ 5 iota >array pprint ] with-variable ] | 
					
						
							|  |  |  |     with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-20 18:30:29 -04:00
										 |  |  | { "{ 0 1 2 3 ~2 more~ }" } [ | 
					
						
							| 
									
										
										
										
											2012-06-01 18:15:29 -04:00
										 |  |  |     [ 5 length-limit [ 6 iota >array pprint ] with-variable ] | 
					
						
							|  |  |  |     with-string-writer | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2013-04-25 23:19:12 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : margin-test ( number-of-'a's -- str )
 | 
					
						
							|  |  |  |     [ | 
					
						
							|  |  |  |         [ CHAR: a <string> text "b" text ] with-pprint | 
					
						
							|  |  |  |     ] with-string-writer ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa b" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ margin get 3 - margin-test ] unit-test | 
					
						
							| 
									
										
										
										
											2013-04-25 23:19:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa b" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ margin get 2 - margin-test ] unit-test | 
					
						
							| 
									
										
										
										
											2013-04-25 23:19:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-07-26 01:59:56 -04:00
										 |  |  | "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 
					
						
							|  |  |  | b" | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | } [ margin get 1 - margin-test ] unit-test |