"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/test/groovy/transform/stc/ReturnsSTCTest.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.

ReturnsSTCTest.groovy  (apache-groovy-src-3.0.8):ReturnsSTCTest.groovy  (apache-groovy-src-3.0.9)
skipping to change at line 201 skipping to change at line 201
void testInferredReturnTypeWithImplicitConversion() { void testInferredReturnTypeWithImplicitConversion() {
shouldFailWithMessages ''' shouldFailWithMessages '''
String methodWithImplicitConversion() { String methodWithImplicitConversion() {
new Date() new Date()
} }
methodWithImplicitConversion().years methodWithImplicitConversion().years
''', 'No such property: years for class: java.lang.String' ''', 'No such property: years for class: java.lang.String'
} }
// GROOVY-10079
void testImplicitReturnToPrimitive() {
assertScript '''
int foo() {
Integer.valueOf(42)
}
assert foo() == 42
'''
assertScript '''
long foo() {
Long.valueOf(1234L)
}
assert foo() == 1234L
'''
assertScript '''
char foo() {
Character.valueOf((char)'x')
}
assert foo() == 'x'
'''
}
// GROOVY-10087
void testImplicitReturnToWrapper() {
assertScript '''
Integer foo() {
int x = 42
return x
}
assert foo().intValue() == 42
'''
assertScript '''
Long foo() {
long x = 42L
return x
}
assert foo().longValue() == 42L
'''
assertScript '''
Character foo() {
char x = 'x'
return x
}
assert foo().charValue() == 'x'
'''
}
// GROOVY-5835 // GROOVY-5835
void testReturnInClosureShouldNotBeConsideredAsReturnOfEnclosingMethod() { void testReturnInClosureShouldNotBeConsideredAsReturnOfEnclosingMethod() {
assertScript ''' assertScript '''
int enclosingMethod() { int enclosingMethod() {
def cl = { return 'String' } // should not think it's a return f or the enclosing method def cl = { return 'String' } // should not think it's a return f or the enclosing method
1 1
} }
''' '''
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 51 lines changed or added

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