blob: 05faf6508d3652a892cc92eeb442da344946b0c8 [file] [log] [blame]
package groovy
class NegationTests extends GroovyTestCase {
void testNegateInteger() {
def a = -1
assert a == -1
}
void testNegateIntegerExpression() {
def a = -1
a = -a
assert a == 1
}
void testNegateDouble() {
def a = -1.0
assert a == -1.0
}
void testNegateDoubleExpression() {
def a = -1.0
a = -a
assert a == 1.0
}
}