|
Groovy example source code file (MultiplyDivideEqualsTest.groovy)
The Groovy MultiplyDivideEqualsTest.groovy source codepackage groovy class MultiplyDivideEqualsTest extends GroovyTestCase { void testIntegerMultiplyEquals() { def x = 2 def y = 3 x *= y assert x == 6 y *= 4 assert y == 12 } void testCharacterMultiplyEquals() { Character x = 2 Character y = 3 x *= y assert x == 6 y *= 4 assert y == 12 } void testNumberMultiplyEquals() { def x = 1.2 def y = 2 x *= y assert x == 2.4 } void testStringMultiplyEquals() { def x = "bbc" def y = 2 x *= y assert x == "bbcbbc" x = "Guillaume" y = 0 x *= y assert x == "" } void testIntegerDivideEquals() { def x = 18 def y = 6 x /= y assert x == 3.0 y /= 3 assert y == 2.0 } void testCharacterDivideEquals() { Character x = 18 Character y = 6 x /= y assert x == 3 y /= 3 assert y == 2 } void testNumberDivideEquals() { def x = 10.4 def y = 2 x /= y assert x == 5.2 } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy MultiplyDivideEqualsTest.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.