IN: temporary USING: kernel io-internals test ; [ "" 65536 ] [ 65536 dup buffer-contents over buffer-capacity rot buffer-free ] unit-test [ "hello world" "" ] [ "hello world" string>buffer dup buffer-contents 0 pick buffer-reset over buffer-contents rot buffer-free ] unit-test [ "hello" ] [ "hello world" string>buffer 5 over buffer-first-n swap buffer-free ] unit-test [ 11 ] [ "hello world" string>buffer [ buffer-length ] keep buffer-free ] unit-test [ "hello world" ] [ "hello" 1024 [ buffer-set ] keep " world" over >buffer dup buffer-contents swap buffer-free ] unit-test [ CHAR: e ] [ "hello" string>buffer 1 over buffer-consume [ buffer-pop ] keep buffer-free ] unit-test