大名鼎鼎的java动态脚本语言。已经通过了sun的认证

源代码在线查看: stringbuffertest.groovy

软件大小: 1630 K
上传用户: hjf
关键词: java sun 动态 脚本
下载地址: 免注册下载 普通下载 VIP

相关代码

				class StringBufferTest extends GroovyTestCase {				    void testSize() {				        def x = new StringBuffer()				        assert x.size() == x.length()				        x = new StringBuffer('some text')				        assert x.size() == x.length()				    }								    void testPutAt(){				        def buf = new StringBuffer('0123')				        buf[1..2] = 'xx'				        assert '0xx3' == buf.toString()  , 'replace with String'				        buf = new StringBuffer('0123')				        buf[1..2] = 99				        assert '0993' == buf.toString()  , 'replace with obj.toString()'				        buf = new StringBuffer('0123')				        buf[0..				        assert 'xx0123' == buf.toString(), 'border case left'				        buf = new StringBuffer('0123')				        buf[4..4] = 'xx'				        println buf.toString()				        assert '0123xx' == buf.toString(), 'border case right'				        // more weird Ranges already tested in ListTest				    }				}			

相关资源