"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/test/gls/invocation/DefaultParamTest.groovy" between
apache-groovy-src-3.0.8.zip and apache-groovy-src-3.0.9.zip

About: Groovy is an agile dynamic (scripting) language for the Java Platform. It has features similar to those of Python, Ruby, Perl, and Smalltalk. Source release.

DefaultParamTest.groovy  (apache-groovy-src-3.0.8):DefaultParamTest.groovy  (apache-groovy-src-3.0.9)
skipping to change at line 142 skipping to change at line 142
// GROOVY-9151 // GROOVY-9151
void testMethodWithAllParametersDefaulted() { void testMethodWithAllParametersDefaulted() {
assertScript ''' assertScript '''
String greet(Object o = 'world', String s = o.toString()) { String greet(Object o = 'world', String s = o.toString()) {
"hello $s" "hello $s"
} }
assert greet() == 'hello world' assert greet() == 'hello world'
''' '''
} }
// GROOVY-6851, GROOVY-9151, GROOVY-10104
void testMethodWithAllParametersDefaultedCS() {
assertScript '''
@groovy.transform.CompileStatic
String greet(Object o = 'world', String s = o.toString()) {
"hello $s"
}
assert greet() == 'hello world'
'''
assertScript '''
@groovy.transform.CompileStatic
class Main {
static main(args) {
assert new Main().test().isEmpty()
}
Map test(Map<String, Object> m = new HashMap<>(Collections.empty
Map())) {
return m
}
}
'''
}
// GROOVY-9151 // GROOVY-9151
void testConstructorWithAllParametersDefaulted() { void testConstructorWithAllParametersDefaulted() {
assertScript ''' assertScript '''
class Greeting { class Greeting {
Greeting(Object o = 'world', String s = o) { Greeting(Object o = 'world', String s = o) {
this.text = "hello $s" this.text = "hello $s"
} }
String text String text
} }
assert new Greeting().text == 'hello world' assert new Greeting().text == 'hello world'
 End of changes. 1 change blocks. 
0 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)