factor/library/test/sbuf.factor

20 lines
508 B
Factor
Raw Normal View History

IN: temporary
2005-05-05 22:30:58 -04:00
USING: kernel math namespaces sequences strings test ;
[ 5 ] [ "Hello" >sbuf length ] unit-test
2004-09-26 21:34:25 -04:00
[ "Hello" ] [
100 <sbuf> "buf" set
"Hello" "buf" get swap nappend
"buf" get clone "buf-clone" set
"World" "buf-clone" get swap nappend
2005-05-05 16:51:38 -04:00
"buf" get >string
] unit-test
2005-04-02 02:39:33 -05:00
[ CHAR: h ] [ 0 SBUF" hello world" nth ] unit-test
2005-04-07 18:54:02 -04:00
[ CHAR: H ] [
CHAR: H 0 SBUF" hello world" [ set-nth ] keep 0 swap nth
] unit-test
2005-05-05 22:30:58 -04:00
[ SBUF" x" ] [ 1 <sbuf> [ CHAR: x >bignum over push ] keep ] unit-test