|
Groovy example source code file (UnaryMinusOperatorTest.groovy)
The Groovy UnaryMinusOperatorTest.groovy source codepackage groovy.operator class UnaryMinusOperatorTest extends GroovyTestCase { void testUnaryMinus() { def value = -1 assert value == -1 def x = value + 2 assert x == 1 def y = -value assert y == 1 } void testBug() { def a = 1 def b = -a assert b == -1 } void testShellBug() { assertScript(""" def a = 1 def b = -a assert b == -1 """) } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy UnaryMinusOperatorTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.