class MinusEqualsTest extends GroovyTestCase { void testIntegerMinusEquals() { def x = 4 def y = 2 x -= y assert x == 2 y -= 1
http://www.codebf.com/read/171479/5394940
/** * Test Math Power Operation in Classic/New Groovy * * @author Pilho Kim * @version $Revision: 1.3 $ */ class PowerOperationTest extends GroovyTestCase { void testConstantPowerOperation
http://www.codebf.com/read/171479/5394942
class MapFromList { void talk(a) { println("hello "+a) } void doit(args) { def i = 1 def l = [:] args.each { talk(it) l.put(it,i++) }
http://www.codebf.com/read/171479/5394943
class GStringTest extends GroovyTestCase { void check(template, teststr) { assert template instanceof GString def count = template.getValueCount() assert count == 1
http://www.codebf.com/read/171479/5394960
class SubscriptTest extends GroovyTestCase { void testListRange() { def list = ['a', 'b', 'c', 'd', 'e'] def sub = list[2..4] assert sub == ['c', 'd', 'e']
http://www.codebf.com/read/171479/5394967
class UnaryMinusTest extends GroovyTestCase { void testUnaryMinus() { def value = -1 assert value == -1 def x = value + 2 assert x == 1
http://www.codebf.com/read/171479/5394969
class TernaryOperatorTest extends GroovyTestCase { void testSimpleUse() { def y = 5 def x = (y > 1) ? "worked" : "failed" assert x == "worked" x = (y < 4) ? "fa
http://www.codebf.com/read/171479/5394971
class SimplePostfixTest extends GroovyTestCase { void testPostfix() { def x = 1 ++x println(x) assert x == 2 } }
http://www.codebf.com/read/171479/5394972
package groovy class CollectionTest extends GroovyTestCase { void testUniqueOnListNoDupls() { assert [].unique() == [] assert [1].unique() == [1] assert [1,2].unique() == [1,2]
http://www.codebf.com/read/171479/5394977
import org.codehaus.groovy.runtime.DummyBean class NewExpressionTest extends GroovyTestCase { void testNewInstance() { def cheese = new String( "hey you hosers" ) assert
http://www.codebf.com/read/171479/5394978
虫虫下载站 半导体技术网 电子研发网 源码地带 电源技术网 单片机技术网 医疗电子技术 嵌入式系统与单片机