| 
									
										
										
										
											2012-08-02 20:41:13 -04:00
										 |  |  | USING: classes kernel math namespaces sbufs sequences | 
					
						
							|  |  |  | sequences.private strings tools.test ;
 | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: sbufs.tests | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ 5 ] [ "Hello" >sbuf length ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ "Hello" ] [ | 
					
						
							|  |  |  |     100 <sbuf> "buf" set
 | 
					
						
							|  |  |  |     "Hello" "buf" get push-all
 | 
					
						
							|  |  |  |     "buf" get clone "buf-clone" set
 | 
					
						
							|  |  |  |     "World" "buf-clone" get push-all
 | 
					
						
							|  |  |  |     "buf" get >string
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ CHAR: h ] [ 0 SBUF" hello world" nth ] unit-test | 
					
						
							|  |  |  | [ CHAR: H ] [ | 
					
						
							|  |  |  |     CHAR: H 0 SBUF" hello world" [ set-nth ] keep first
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ SBUF" x" ] [ 1 <sbuf> CHAR: x >bignum over push ] unit-test | 
					
						
							| 
									
										
										
										
											2007-10-07 18:15:48 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-24 22:33:09 -04:00
										 |  |  | [ fixnum ] [ 1 >bignum SBUF" " new-sequence length class-of ] unit-test | 
					
						
							| 
									
										
										
										
											2007-10-07 18:15:48 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-24 22:33:09 -04:00
										 |  |  | [ fixnum ] [ 1 >bignum iota [ ] SBUF" " map-as length class-of ] unit-test | 
					
						
							| 
									
										
										
										
											2012-08-02 18:24:31 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ 1.5 SBUF" " new-sequence ] must-fail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ CHAR: A 0.5 0.5 SBUF" a" set-nth-unsafe ] must-fail |