/** | |
* Closure Example test cases. | |
*/ | |
class Closures { | |
def someClosures() { | |
// c1 = {print "hello"} //@pass | |
// c2 = {foo| print foo} //@fail:parse | |
// c3 = {|bar| print bar} //@pass | |
// c4 = {|String telson| println telson} //@pass | |
// c5 = {|Cool car, funky, Moped yeah| println yeah + funky + car} //@pass | |
// c6 = {|String name, age| println "${name) is ${age} years old"} //@pass | |
// myList.each{print it} //@pass | |
// myList.each{foo|print foo} //@fail:parse | |
// myList.each{|bar|print bar} //@pass | |
} | |
} |